Re: [PATCH v3] platform/x86: lenovo: wmi-other: Fix uninitialized variable in lwmi_om_hwmon_write()

From: Ilpo Järvinen

Date: Thu Apr 30 2026 - 09:56:58 EST


On Mon, 27 Apr 2026 00:50:34 +0800, Yufei CHENG wrote:

> 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.
>
> [...]


Thank you for your contribution, it has been applied to my local
review-ilpo-fixes branch. Note it will show up in the public
platform-drivers-x86/review-ilpo-fixes branch only once I've pushed my
local branch there, which might take a while.

The list of commits applied:
[1/1] platform/x86: lenovo: wmi-other: Fix uninitialized variable in lwmi_om_hwmon_write()
commit: 863810d4985ad214f70c1623f24384ccc850f2a2

--
i.