diff mbox series

[SRU,G/linux-oracle,10/18] perf/arm_dmc620_pmu: Fix error return code in dmc620_pmu_device_probe()

Message ID 20210521070042.1445-13-khalid.elmously@canonical.com
State New
Headers show
Series arm64 support | expand

Commit Message

Khalid Elmously May 21, 2021, 7 a.m. UTC
From: Wei Yongjun <weiyongjun1@huawei.com>

BugLink: https://bugs.launchpad.net/bugs/1925421

Fix to return negative error code -ENOMEM from the error handling
case instead of 0, as done elsewhere in this function.

Fixes: 53c218da220c ("driver/perf: Add PMU driver for the ARM DMC-620 memory controller")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Link: https://lore.kernel.org/r/20210312080421.277562-1-weiyongjun1@huawei.com
Signed-off-by: Will Deacon <will@kernel.org>
(cherry picked from commit c8e3866836528a4ba3b0535834f03768d74f7d8e)
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
---
 drivers/perf/arm_dmc620_pmu.c | 1 +
 1 file changed, 1 insertion(+)
diff mbox series

Patch

diff --git a/drivers/perf/arm_dmc620_pmu.c b/drivers/perf/arm_dmc620_pmu.c
index 004930eb4bbb..b50b47f1a0d9 100644
--- a/drivers/perf/arm_dmc620_pmu.c
+++ b/drivers/perf/arm_dmc620_pmu.c
@@ -681,6 +681,7 @@  static int dmc620_pmu_device_probe(struct platform_device *pdev)
 	if (!name) {
 		dev_err(&pdev->dev,
 			  "Create name failed, PMU @%pa\n", &res->start);
+		ret = -ENOMEM;
 		goto out_teardown_dev;
 	}