Skip to content

Commit 1fac317

Browse files
Cryolitiagroeck
authored andcommitted
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: 0ab88e2 ("hwmon: add GPD devices sensor driver") Reported-by: Chenx Dust <chenx_dust@outlook.com> Link: Cryolitia/gpd-fan-driver#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>
1 parent bef3c79 commit 1fac317

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/hwmon/gpd-fan.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,7 @@ static int gpd_fan_hwmon_write(__always_unused struct device *dev,
571571
ret = 0;
572572
goto OUT;
573573
case hwmon_pwm_input:
574-
if (!in_range(val, 0, 255)) {
574+
if (!in_range(val, 0, 256)) {
575575
ret = -ERANGE;
576576
goto OUT;
577577
}

0 commit comments

Comments
 (0)