diff mbox series

[-next] perf/arm_dmc620_pmu: Fix error return code in dmc620_pmu_device_probe()

Message ID 20210312080421.277562-1-weiyongjun1@huawei.com (mailing list archive)
State New, archived
Headers show
Series [-next] perf/arm_dmc620_pmu: Fix error return code in dmc620_pmu_device_probe() | expand

Commit Message

Wei Yongjun March 12, 2021, 8:04 a.m. UTC
From: Wei Yongjun <weiyongjun1@huawei.com>

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>
---
 drivers/perf/arm_dmc620_pmu.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Will Deacon March 12, 2021, 11:44 a.m. UTC | #1
On Fri, 12 Mar 2021 08:04:21 +0000, 'Wei Yongjun wrote:
> Fix to return negative error code -ENOMEM from the error handling
> case instead of 0, as done elsewhere in this function.

Applied to arm64 (for-next/fixes), thanks!

[1/1] perf/arm_dmc620_pmu: Fix error return code in dmc620_pmu_device_probe()
      https://git.kernel.org/arm64/c/c8e386683652

Cheers,
diff mbox series

Patch

diff --git a/drivers/perf/arm_dmc620_pmu.c b/drivers/perf/arm_dmc620_pmu.c
index 66ad5b3ece19..f2a85500258d 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;
 	}