Skip to content

Commit 4e16f28

Browse files
Tuan Phanwilldeacon
authored andcommitted
perf/arm-cmn: Fix invalid pointer when access dtc object sharing the 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 <tuanphan@os.amperecomputing.com> Reviewed-by: Robin Murphy <robin.murphy@arm.com> Link: https://lore.kernel.org/r/1623946129-3290-1-git-send-email-tuanphan@os.amperecomputing.com Signed-off-by: Will Deacon <will@kernel.org>
1 parent 64432f0 commit 4e16f28

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/perf/arm-cmn.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1212,7 +1212,7 @@ static int arm_cmn_init_irqs(struct arm_cmn *cmn)
12121212
irq = cmn->dtc[i].irq;
12131213
for (j = i; j--; ) {
12141214
if (cmn->dtc[j].irq == irq) {
1215-
cmn->dtc[j].irq_friend = j - i;
1215+
cmn->dtc[j].irq_friend = i - j;
12161216
goto next;
12171217
}
12181218
}

0 commit comments

Comments
 (0)