Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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: Vadim Pasternak <[email protected]> Fixes: 35edbaa ("hwmon: (mlxreg-fan) Extend driver to support multiply cooling devices") Signed-off-by: Colin Ian King <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Guenter Roeck <[email protected]>
- Loading branch information