Skip to content
This repository has been archived by the owner on Jul 16, 2024. It is now read-only.

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: 0ba64770a2f2 ("perf: Add Arm CMN-600 PMU driver")

Signed-off-by: Tuan Phan <[email protected]>
  • Loading branch information
Tuan Phan authored and tphan-ampere committed Jun 18, 2021
1 parent 7b8a53c commit 5384c1c
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 @@ -1210,7 +1210,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 5384c1c

Please sign in to comment.