Commit 1fbb83f9 authored by Yicong Yang's avatar Yicong Yang Committed by Junhao He
Browse files

drivers/perf: hisi_pcie: Check the type first in pmu::event_init()

maillist inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I8BOML
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/will/linux.git/commit/?h=for-next/perf&id=6d7d51e88e21c0af1ca96a3617afef334bfeffcf



--------------------------------

Check whether the event type matches the PMU type firstly in
pmu::event_init() before touching the event. Otherwise we'll
change the events of others and lead to incorrect results.
Since in perf_init_event() we may call every pmu's event_init()
in a certain case, we should not modify the event if it's not
ours.

Fixes: 8404b0fb ("drivers/perf: hisi: Add driver for HiSilicon PCIe PMU")
Signed-off-by: default avatarYicong Yang <yangyicong@hisilicon.com>
Link: https://lore.kernel.org/r/20231024092954.42297-2-yangyicong@huawei.com


Signed-off-by: default avatarWill Deacon <will@kernel.org>
Signed-off-by: default avatarJunhao He <hejunhao3@huawei.com>
parent dac6bbe8
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment