Re: [PATCH] platform/x86/intel/pmc: initialize empty PMT read result

From: David Box

Date: Fri Jul 10 2026 - 12:17:49 EST


On Tue, Jun 30, 2026 at 12:51:01PM +0200, Yousef Alhouseen wrote:
> pmc_core_pmt_get_lpm_req() returns the last telemetry read status. When
> firmware exposes no enabled low-power modes, the loop does not run
> and the function returns an uninitialized stack value.
>
> Initialize the status to success so an empty mode set is handled
> deterministically.
>
> Signed-off-by: Yousef Alhouseen <alhouseenyousef@xxxxxxxxx>
> ---
> drivers/platform/x86/intel/pmc/core.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/platform/x86/intel/pmc/core.c b/drivers/platform/x86/intel/pmc/core.c
> index 825ba5fa0bcb..9f77c0716e59 100644
> --- a/drivers/platform/x86/intel/pmc/core.c
> +++ b/drivers/platform/x86/intel/pmc/core.c
> @@ -1583,7 +1583,7 @@ int pmc_core_pmt_get_lpm_req(struct pmc_dev *pmcdev, struct pmc *pmc, struct tel
> {
> const u8 *lpm_indices;
> int num_maps, mode_offset = 0;
> - int ret, lpm_size;
> + int ret = 0, lpm_size;
> u8 mode;
>
> lpm_indices = pmc->map->lpm_reg_index;
> --
> 2.54.0
>

Reviewed-by: David E. Box <david.e.box@xxxxxxxxxxxxxxx>

Thanks