alistair23-linux/drivers/soundwire
Colin Ian King 0132af05fc 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: d52d7a1be0 ("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>
2018-01-08 17:53:20 +01:00
..
bus.c soundwire: fix sign extension when shifting buf[2] 24 places 2018-01-08 17:53:20 +01:00
bus.h soundwire: Add slave status handling 2017-12-19 11:28:13 +01:00
bus_type.c soundwire: Add MIPI DisCo property helpers 2017-12-19 11:14:57 +01:00
cadence_master.c soundwire: cdns: Add sdw_master_ops and IO transfer support 2017-12-19 11:31:33 +01:00
cadence_master.h soundwire: cdns: Add sdw_master_ops and IO transfer support 2017-12-19 11:31:33 +01:00
intel.c soundwire: intel: Add Intel Master driver 2017-12-19 11:32:02 +01:00
intel.h soundwire: intel: Add Intel Master driver 2017-12-19 11:32:02 +01:00
intel_init.c soundwire: intel: Add Intel init module 2017-12-19 11:32:35 +01:00
Kconfig soundwire: intel: Add Intel Master driver 2017-12-19 11:32:02 +01:00
Makefile soundwire: intel: Add Intel init module 2017-12-19 11:32:35 +01:00
mipi_disco.c soundwire: Add MIPI DisCo property helpers 2017-12-19 11:14:57 +01:00
slave.c soundwire: Add Master registration 2017-12-19 11:14:56 +01:00