diff options
| author | 2020-11-05 11:50:19 +0000 | |
|---|---|---|
| committer | 2020-12-02 17:42:23 -0800 | |
| commit | 90673f713fceaa50eef1bff0bcc8ee4e6fbc8953 (patch) | |
| tree | 861b45f2f5b84e96ccaf80ab470bdcfe8422d9f0 /include/linux/mfd/git:/ssh:/git@git.zx2c4.com | |
| parent | hwmon: add Corsair PSU HID controller driver (diff) | |
| download | linux-dev-90673f713fceaa50eef1bff0bcc8ee4e6fbc8953.tar.xz linux-dev-90673f713fceaa50eef1bff0bcc8ee4e6fbc8953.zip | |
hwmon: (corsair-psu) fix unintentional sign extension issue
The shifting of the u8 integer data[3] by 24 bits to the left will
be promoted to a 32 bit signed int and then sign-extended to a
long. In the event that the top bit of data[3] 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 data[3] to
a long before the shift.
Addresses-Coverity: ("Unintended sign extension")
Fixes: ce15cd2cee8b ("hwmon: add Corsair PSU HID controller driver")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20201105115019.41735-1-colin.king@canonical.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'include/linux/mfd/git:/ssh:/git@git.zx2c4.com')
0 files changed, 0 insertions, 0 deletions
