Commit 1fac317b authored by Cryolitia PukNgae's avatar Cryolitia PukNgae Committed by Guenter Roeck
Browse files

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: 0ab88e23 ("hwmon: add GPD devices sensor driver")
Reported-by: default avatarChenx Dust <chenx_dust@outlook.com>
Link: https://github.com/Cryolitia/gpd-fan-driver/pull/18


Co-developed-by: default avatarChenx Dust <chenx_dust@outlook.com>
Signed-off-by: default avatarChenx Dust <chenx_dust@outlook.com>
Signed-off-by: default avatarCryolitia PukNgae <cryolitia@uniontech.com>
Link: https://lore.kernel.org/r/20250919-hwmon-v1-1-2b69c8b9c062@uniontech.com


Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
parent bef3c793
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -571,7 +571,7 @@ static int gpd_fan_hwmon_write(__always_unused struct device *dev,
			ret = 0;
			goto OUT;
		case hwmon_pwm_input:
			if (!in_range(val, 0, 255)) {
			if (!in_range(val, 0, 256)) {
				ret = -ERANGE;
				goto OUT;
			}