Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

hwmon: (gpd-fan) Fix range check for pwm input

Fixed the maximum value in the PWM input range check, allowing the
input to be set to 255.

Fixes: 0ab88e239439 ("hwmon: add GPD devices sensor driver")
Reported-by: Chenx Dust <chenx_dust@outlook.com>
Link: https://github.com/Cryolitia/gpd-fan-driver/pull/18
Co-developed-by: Chenx Dust <chenx_dust@outlook.com>
Signed-off-by: Chenx Dust <chenx_dust@outlook.com>
Signed-off-by: Cryolitia PukNgae <cryolitia@uniontech.com>
Link: https://lore.kernel.org/r/20250919-hwmon-v1-1-2b69c8b9c062@uniontech.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>

authored by

Cryolitia PukNgae and committed by
Guenter Roeck
1fac317b bef3c793

+1 -1
+1 -1
drivers/hwmon/gpd-fan.c
··· 571 571 ret = 0; 572 572 goto OUT; 573 573 case hwmon_pwm_input: 574 - if (!in_range(val, 0, 255)) { 574 + if (!in_range(val, 0, 256)) { 575 575 ret = -ERANGE; 576 576 goto OUT; 577 577 }