linux/drivers/platform/x86/lenovo
Yufei CHENG 863810d498
platform/x86: lenovo: wmi-other: Fix uninitialized variable in lwmi_om_hwmon_write()
When the flag relax_fan_constraint is set, local variable 'raw'
is never assigned, and lwmi_om_hwmon_write() will pass uninitialized
value to lwmi_om_fan_get_set() resulting in undefined behavior.

This flag allows user to bypass minimum fan RPM divisor rounding,
but assignment to 'raw' only happens in the non-relaxed path.
Fix by defaulting 'raw' to user provided 'val' in the else branch.

Fixes: 51ed34282f ("platform/x86: lenovo-wmi-other: Add HWMON for fan reporting/tuning")
Reviewed-by: Rong Zhang <i@rong.moe>
Signed-off-by: Yufei CHENG <cd345al@gmail.com>
Link: https://patch.msgid.link/20260426165034.9073-1-cd345al@gmail.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
2026-04-30 15:41:18 +03:00
..
ideapad-laptop.c platform/wmi: Replace .no_notify_data with .min_event_size 2026-04-13 14:11:27 +03:00
ideapad-laptop.h
Kconfig platform/x86: lenovo-wmi-other: Add HWMON for fan reporting/tuning 2026-01-21 10:49:58 +02:00
Makefile platform/x86: Rename lenovo-wmi-capdata01 to lenovo-wmi-capdata 2026-01-21 10:49:51 +02:00
think-lmi.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
think-lmi.h platform/x86: think-lmi: Certificate support for ThinkCenter 2025-09-04 15:48:08 +03:00
thinkpad_acpi.c platform/x86: thinkpad_acpi: remove obsolete TODO comment 2026-04-09 15:50:51 +03:00
wmi-camera.c platform/wmi: Replace .no_notify_data with .min_event_size 2026-04-13 14:11:27 +03:00
wmi-capdata.c ACPI: AC: Define ACPI_AC_CLASS in one place 2026-03-13 16:48:28 +01:00
wmi-capdata.h platform/x86: lenovo-wmi-{capdata,other}: Fix HWMON channel visibility 2026-02-10 17:22:40 +02:00
wmi-events.c platform/wmi: Replace .no_notify_data with .min_event_size 2026-04-13 14:11:27 +03:00
wmi-events.h
wmi-gamezone.c platform/x86: lenovo: wmi-gamezone: Drop gz_chain_head 2026-03-23 14:48:59 +02:00
wmi-gamezone.h
wmi-helpers.c platform/x86: lenovo-wmi-helpers: Convert returned buffer into u32 2026-01-21 10:49:48 +02:00
wmi-helpers.h
wmi-hotkey-utilities.c
wmi-other.c platform/x86: lenovo: wmi-other: Fix uninitialized variable in lwmi_om_hwmon_write() 2026-04-30 15:41:18 +03:00
wmi-other.h
ymc.c platform/wmi: Replace .no_notify_data with .min_event_size 2026-04-13 14:11:27 +03:00
yoga-tab2-pro-1380-fastcharger.c platform/x86: x86-android-tablets: convert Yoga Tab2 fast charger to GPIO references 2025-09-26 14:26:25 +03:00
yogabook.c platform/wmi: Replace .no_notify_data with .min_event_size 2026-04-13 14:11:27 +03:00