Skip to content
Snippets Groups Projects
user avatar
Guenter Roeck authored
Commit cc66b303 ("hwmon: (nct6775) Rework temperature source and label
handling") changed a loop limit from "data->temp_label_num - 1" to "32",
as part of moving from a string array to a bit mask. This results in the
following error, reported by UBSAN.

UBSAN: Undefined behaviour in drivers/hwmon/nct6775.c:4179:27
shift exponent 32 is too large for 32-bit type 'long unsigned int'

Similar to the original loop, the limit has to be one less than the
number of bits.

Fixes: cc66b303 ("hwmon: (nct6775) Rework temperature source and label handling")
Reported-by: default avatarPaul Menzel <pmenzel+linux-hwmon@molgen.mpg.de>
Cc: Paul Menzel <pmenzel+linux-hwmon@molgen.mpg.de>
Tested-by: default avatarPaul Menzel <pmenzel+linux-hwmon@molgen.mpg.de>
Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
91bb8f45
History
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
Name Last commit Last update
..