platform/x86/intel/pmc: initialize empty PMT read result
Subsystems (2)
PATCH 1/1 platform/x86/intel/pmc: initialize empty PMT read result
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.
--- drivers/platform/x86/intel/pmc/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/platform/x86/intel/pmc/core.c +1 -1
@@ -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;
Signature · 1 line
2.54.0
Quoted 28 lines · Yousef Alhouseen
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 <[email protected]>--- drivers/platform/x86/intel/pmc/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/platform/x86/intel/pmc/core.c +1
-1@@ -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;Signature · 1 line
2.54.0
Thanks
Ilpo Järvinen
maintainerQuoted 8 lines · Yousef Alhouseen
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.
[...]
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: initialize empty PMT read result
commit: 408b87a481e3ab33cba00292e4c80a30ba97f995
--
i.