Skip to content

Commit fbcf67c

Browse files
rjingarij-intel
authored andcommitted
platform/x86/intel/pmc: Fix hang in pmc_core_send_ltr_ignore()
For input value 0, PMC stays unassigned which causes crash while trying to access PMC for register read/write. Include LTR index 0 in pmc_index and ltr_index calculation. Fixes: 2bcef45 ("platform/x86:intel/pmc: Enable debugfs multiple PMC support") Signed-off-by: Rajvi Jingar <[email protected]> Reviewed-by: Ilpo Järvinen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Ilpo Järvinen <[email protected]>
1 parent 66e92e2 commit fbcf67c

File tree

1 file changed

+1
-1
lines changed
  • drivers/platform/x86/intel/pmc

1 file changed

+1
-1
lines changed

drivers/platform/x86/intel/pmc/core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ int pmc_core_send_ltr_ignore(struct pmc_dev *pmcdev, u32 value)
472472
* is based on the contiguous indexes from ltr_show output.
473473
* pmc index and ltr index needs to be calculated from it.
474474
*/
475-
for (pmc_index = 0; pmc_index < ARRAY_SIZE(pmcdev->pmcs) && ltr_index > 0; pmc_index++) {
475+
for (pmc_index = 0; pmc_index < ARRAY_SIZE(pmcdev->pmcs) && ltr_index >= 0; pmc_index++) {
476476
pmc = pmcdev->pmcs[pmc_index];
477477

478478
if (!pmc)

0 commit comments

Comments
 (0)