diff options
author | Colin Ian King <[email protected]> | 2020-11-18 13:05:20 +0000 |
---|---|---|
committer | Jakub Kicinski <[email protected]> | 2020-11-20 11:05:16 -0800 |
commit | 583b273dea75720ce74cc45afeeb96d88246e582 (patch) | |
tree | 5613ec8fda5f6b1cb6b549b0401803934f94390c /net/lapb/lapb_timer.c | |
parent | b5fb0b1bbb5021339cfe9e9fe8177a50047545f1 (diff) |
octeontx2-pf: Fix unintentional sign extension issue
The shifting of the u16 result from ntohs(proto) by 16 bits to the
left will be promoted to a 32 bit signed int and then sign-extended
to a u64. In the event that the top bit of the return from ntohs(proto)
is set then all then all the upper 32 bits of a 64 bit long end up as
also being set because of the sign-extension. Fix this by casting to
a u64 long before the shift.
Addresses-Coverity: ("Unintended sign extension")
Fixes: f0c2982aaf98 ("octeontx2-pf: Add support for SR-IOV management function")
Signed-off-by: Colin Ian King <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jakub Kicinski <[email protected]>
Diffstat (limited to 'net/lapb/lapb_timer.c')
0 files changed, 0 insertions, 0 deletions