[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20250919-hwmon-v1-1-2b69c8b9c062@uniontech.com>
Date: Fri, 19 Sep 2025 16:38:49 +0800
From: Cryolitia PukNgae via B4 Relay <devnull+cryolitia.uniontech.com@...nel.org>
To: Guenter Roeck <linux@...ck-us.net>
Cc: linux-hwmon@...r.kernel.org, linux-kernel@...r.kernel.org,
niecheng1@...ontech.com, zhanjun@...ontech.com,
Chenx Dust <chenx_dust@...look.com>,
Cryolitia PukNgae <cryolitia@...ontech.com>
Subject: [PATCH] hwmon: (gpd-fan) Fix range check for pwm input
From: Cryolitia PukNgae <cryolitia@...ontech.com>
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@...look.com>
Link: https://github.com/Cryolitia/gpd-fan-driver/pull/18
Co-developed-by: Chenx Dust <chenx_dust@...look.com>
Signed-off-by: Chenx Dust <chenx_dust@...look.com>
Signed-off-by: Cryolitia PukNgae <cryolitia@...ontech.com>
---
drivers/hwmon/gpd-fan.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/hwmon/gpd-fan.c b/drivers/hwmon/gpd-fan.c
index e0b3b46e1bf12a10097600f857c627a766f61a27..644dc3ca9df7da0174e513c47a820a6ff39eb0ef 100644
--- a/drivers/hwmon/gpd-fan.c
+++ b/drivers/hwmon/gpd-fan.c
@@ -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;
}
---
base-commit: 80038a758b7fc0cdb6987532cbbf3f75b13e0826
change-id: 20250919-hwmon-9703a3da195a
Best regards,
--
Cryolitia PukNgae <cryolitia@...ontech.com>
Powered by blists - more mailing lists