Skip to content
Commit 000cc5bc authored by Colin Ian King's avatar Colin Ian King Committed by Guenter Roeck
Browse files

hwmon: (mlxreg-fan) Fix out of bounds read on array fan->pwm



Array fan->pwm[] is MLXREG_FAN_MAX_PWM elements in size, however the
for-loop has a off-by-one error causing index i to be out of range
causing an out of bounds read on the array. Fix this by replacing
the <= operator with < in the for-loop.

Addresses-Coverity: ("Out-of-bounds read")
Reported-by: default avatarVadim Pasternak <vadimp@nvidia.com>
Fixes: 35edbaab3bbf ("hwmon: (mlxreg-fan) Extend driver to support multiply cooling devices")
Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20210920180921.16246-1-colin.king@canonical.com


Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
parent 3fbbfc27
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment