Skip to content

Commit fae00a7

Browse files
Wer-Wolfgroeck
authored andcommitted
hwmon: (dell-smm) Fix off-by-one error in dell_smm_is_visible()
The documentation states that on machines supporting only global fan mode control, the pwmX_enable attributes should only be created for the first fan channel (pwm1_enable, aka channel 0). Fix the off-by-one error caused by the fact that fan channels have a zero-based index. Cc: stable@vger.kernel.org Fixes: 1c16580 ("hwmon: (dell-smm) Add support for automatic fan mode") Signed-off-by: Armin Wolf <W_Armin@gmx.de> Link: https://lore.kernel.org/r/20251203202109.331528-1-W_Armin@gmx.de Signed-off-by: Guenter Roeck <linux@roeck-us.net>
1 parent 670d7ef commit fae00a7

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/hwmon/dell-smm-hwmon.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -861,9 +861,9 @@ static umode_t dell_smm_is_visible(const void *drvdata, enum hwmon_sensor_types
861861
if (auto_fan) {
862862
/*
863863
* The setting affects all fans, so only create a
864-
* single attribute.
864+
* single attribute for the first fan channel.
865865
*/
866-
if (channel != 1)
866+
if (channel != 0)
867867
return 0;
868868

869869
/*

0 commit comments

Comments
 (0)