Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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: 1c1658058c99 ("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>

authored by

Armin Wolf and committed by
Guenter Roeck
fae00a71 670d7ef9

+2 -2
+2 -2
drivers/hwmon/dell-smm-hwmon.c
··· 861 861 if (auto_fan) { 862 862 /* 863 863 * The setting affects all fans, so only create a 864 - * single attribute. 864 + * single attribute for the first fan channel. 865 865 */ 866 - if (channel != 1) 866 + if (channel != 0) 867 867 return 0; 868 868 869 869 /*