summaryrefslogtreecommitdiffstats
path: root/drivers/soundwire/intel.c
diff options
context:
space:
mode:
authorColin Ian King <colin.king@canonical.com>2018-01-08 22:22:42 +0530
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-01-08 17:53:20 +0100
commit0132af05fc8b3f36bdf5273b146af09ff6421d61 (patch)
tree294d25ec51c1bb42dc6f509cb12e00334500f6e9 /drivers/soundwire/intel.c
parent24d142d5be8f195b6c08ca1868885cf3a546444a (diff)
downloadlinux-0132af05fc8b3f36bdf5273b146af09ff6421d61.tar.bz2
soundwire: fix sign extension when shifting buf[2] 24 places
The buf[2] left shift by 24 bits is promoted to int (32 bit signed) and then signed-extended to unsigned long long. Hence if the upper bit to buf[2] is set then all the upper bits of addr end up as 1. Fix this by casting it to u64 before shifting it. Also replace the unsigned long long casts to u64 casts to match the same type of addr. Detected by CoverityScan, CID#1463147 ("Unintended sign extension") Fixes: d52d7a1be02c ("soundwire: Add Slave status handling helpers") Signed-off-by: Colin Ian King <colin.king@canonical.com> Acked-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/soundwire/intel.c')
0 files changed, 0 insertions, 0 deletions