OpenCloudOS-Kernel/drivers/perf/hisilicon
Hao Chen a7678a16c2 drivers/perf: hisi: hns3: Actually use devm_add_action_or_reset()
[ Upstream commit 582c1aeee0a9e73010cf1c4cef338709860deeb0 ]

pci_alloc_irq_vectors() allocates an irq vector. When devm_add_action()
fails, the irq vector is not freed, which leads to a memory leak.

Replace the devm_add_action with devm_add_action_or_reset to ensure
the irq vector can be destroyed when it fails.

Fixes: 66637ab137 ("drivers/perf: hisi: add driver for HNS3 PMU")
Signed-off-by: Hao Chen <chenhao418@huawei.com>
Signed-off-by: Junhao He <hejunhao3@huawei.com>
Reviewed-by: Jijie Shao <shaojijie@huawei.com>
Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Link: https://lore.kernel.org/r/20240425124627.13764-4-hejunhao3@huawei.com
Signed-off-by: Will Deacon <will@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-06-12 11:11:47 +02:00
..
Kconfig drivers/perf: hisi: add driver for HNS3 PMU 2022-07-06 11:25:53 +01:00
Makefile drivers/perf: hisi: Add support for HiSilicon UC PMU driver 2023-06-16 12:27:38 +01:00
hisi_pcie_pmu.c drivers/perf: hisi_pcie: Fix out-of-bound access when valid event group 2024-06-12 11:11:46 +02:00
hisi_uncore_cpa_pmu.c drivers/perf: hisi: Remove redundant initialized of pmu->name 2023-04-17 13:14:10 +01:00
hisi_uncore_ddrc_pmu.c drivers/perf: hisi: add NULL check for name 2023-04-17 13:14:10 +01:00
hisi_uncore_hha_pmu.c drivers/perf: hisi: add NULL check for name 2023-04-17 13:14:10 +01:00
hisi_uncore_l3c_pmu.c drivers/perf: hisi: add NULL check for name 2023-04-17 13:14:10 +01:00
hisi_uncore_pa_pmu.c perf: hisi: Fix use-after-free when register pmu fails 2023-11-20 11:59:13 +01:00
hisi_uncore_pmu.c drivers/perf: hisi: Add support for HiSilicon UC PMU driver 2023-06-16 12:27:38 +01:00
hisi_uncore_pmu.h drivers/perf: hisi: Add support for HiSilicon UC PMU driver 2023-06-16 12:27:38 +01:00
hisi_uncore_sllc_pmu.c perf: hisi: Fix use-after-free when register pmu fails 2023-11-20 11:59:13 +01:00
hisi_uncore_uc_pmu.c drivers/perf: hisi: Enable HiSilicon Erratum 162700402 quirk for HIP09 2024-04-13 13:07:36 +02:00
hns3_pmu.c drivers/perf: hisi: hns3: Actually use devm_add_action_or_reset() 2024-06-12 11:11:47 +02:00