mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] hwmon: (gpd-fan) Fix range check for pwm input
@ 2025-09-19  8:38 Cryolitia PukNgae via B4 Relay
  2025-09-24 14:38 ` Guenter Roeck
  0 siblings, 1 reply; 2+ messages in thread
From: Cryolitia PukNgae via B4 Relay @ 2025-09-19  8:38 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: linux-hwmon, linux-kernel, niecheng1, zhanjun, Chenx Dust,
	Cryolitia PukNgae

From: Cryolitia PukNgae <cryolitia@uniontech.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@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>
---
 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@uniontech.com>



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-09-24 14:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-09-19  8:38 [PATCH] hwmon: (gpd-fan) Fix range check for pwm input Cryolitia PukNgae via B4 Relay
2025-09-24 14:38 ` Guenter Roeck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®