Re: [PATCH] platform/x86/intel/pmc: Fix mode check in pmc_core_lpm_latch_mode_write()

From: Ilpo Järvinen

Date: Fri Dec 04 2026 - 13:44:33 EST


On Thu, 19 Nov 2026 09:10:33 -0800, Ian Rogers wrote:

> In pmc_core_lpm_latch_mode_write(), when pmc->num_lpm_modes is 0 (all
> S0ix substates disabled), pmc_for_each_mode(m, pmc) terminates without
> assigning m. The subsequent 'if (mode != m || mode < 0)' check then
> reads uninitialized stack memory for m; under zero stack
> initialization (m == 0), writing "S0i2.0" (mode == 0) evaluates
> '0 != 0' as false and latches a disabled substate.
>
> [...]

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

FYI [if applicable to your patch], as per Linus' policy change, also
fixes are mostly routed through for-next unless the fix is for a
commit introduced in the most recent cycle or is clearly a regression
fix.

The list of commits applied:
[1/1] platform/x86/intel/pmc: Fix mode check in pmc_core_lpm_latch_mode_write()
commit: 6af355b5a0125871f0ede905c303b80bfae34d7e

--
i.