Skip to content

Commit

Permalink
perf/arm-cmn: Fix invalid pointer when access dtc object sharing the …
Browse files Browse the repository at this point in the history
…same IRQ number

When multiple dtcs share the same IRQ number, the irq_friend which
used to refer to dtc object gets calculated incorrect which leads
to invalid pointer.

Fixes: 0ba6477 ("perf: Add Arm CMN-600 PMU driver")

Signed-off-by: Tuan Phan <[email protected]>
Reviewed-by: Robin Murphy <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Will Deacon <[email protected]>
  • Loading branch information
Tuan Phan authored and willdeacon committed Jun 17, 2021
1 parent 64432f0 commit 4e16f28
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/perf/arm-cmn.c
Original file line number Diff line number Diff line change
Expand Up @@ -1212,7 +1212,7 @@ static int arm_cmn_init_irqs(struct arm_cmn *cmn)
irq = cmn->dtc[i].irq;
for (j = i; j--; ) {
if (cmn->dtc[j].irq == irq) {
cmn->dtc[j].irq_friend = j - i;
cmn->dtc[j].irq_friend = i - j;
goto next;
}
}
Expand Down

0 comments on commit 4e16f28

Please sign in to comment.