summaryrefslogtreecommitdiff
path: root/drivers/of
diff options
context:
space:
mode:
authorColin Ian King <colin.king@canonical.com>2020-11-09 15:40:08 +0300
committerJakub Kicinski <kuba@kernel.org>2020-11-11 04:46:20 +0300
commit2776d2320ac186988273a9b312073317b6c50c76 (patch)
tree84e452df666cbe3e337d2ecb913c2aa3267a6b65 /drivers/of
parente5a4b17da1d0d8ce5b56efe618ae107add78c7b0 (diff)
downloadlinux-2776d2320ac186988273a9b312073317b6c50c76.tar.xz
net: dsa: fix unintended sign extension on a u16 left shift
The left shift of u16 variable high is promoted to the type int and then sign extended to a 64 bit u64 value. If the top bit of high is set then the upper 32 bits of the result end up being set by the sign extension. Fix this by explicitly casting the value in high to a u64 before left shifting by 16 places. Also, remove the initialisation of variable value to 0 at the start of each loop iteration as the value is never read and hence the assignment it is redundant. Addresses-Coverity: ("Unintended sign extension") Fixes: e4b27ebc780f ("net: dsa: Add DSA driver for Hirschmann Hellcreek switches") Signed-off-by: Colin Ian King <colin.king@canonical.com> Reviewed-by: Kurt Kanzenbach <kurt@linutronix.de> Link: https://lore.kernel.org/r/20201109124008.2079873-1-colin.king@canonical.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/of')
0 files changed, 0 insertions, 0 deletions