2021-06-17 16:04:10

by Jing Xiangfeng

[permalink] [raw]
Subject: [PATCH] drivers/perf: fix the missed ida_simple_remove() in ddr_perf_probe()

ddr_perf_probe() misses to call ida_simple_remove() in an error path.
Jump to cpuhp_state_err to fix it.

Signed-off-by: Jing Xiangfeng <[email protected]>
---
drivers/perf/fsl_imx8_ddr_perf.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/perf/fsl_imx8_ddr_perf.c b/drivers/perf/fsl_imx8_ddr_perf.c
index 2bbb93188064..7b87aaf267d5 100644
--- a/drivers/perf/fsl_imx8_ddr_perf.c
+++ b/drivers/perf/fsl_imx8_ddr_perf.c
@@ -705,8 +705,10 @@ static int ddr_perf_probe(struct platform_device *pdev)

name = devm_kasprintf(&pdev->dev, GFP_KERNEL, DDR_PERF_DEV_NAME "%d",
num);
- if (!name)
- return -ENOMEM;
+ if (!name) {
+ ret = -ENOMEM;
+ goto cpuhp_state_err;
+ }

pmu->devtype_data = of_device_get_match_data(&pdev->dev);

--
2.26.0.106.g9fadedd


2021-06-17 16:04:38

by Aisheng Dong

[permalink] [raw]
Subject: RE: [PATCH] drivers/perf: fix the missed ida_simple_remove() in ddr_perf_probe()

> From: Jing Xiangfeng <[email protected]>
> Sent: Thursday, June 17, 2021 8:26 PM
> Subject: [PATCH] drivers/perf: fix the missed ida_simple_remove() in
> ddr_perf_probe()
>

drivers/perf: imx8_ddr: xxxx

Otherwise:

Reviewed-by: Dong Aisheng <[email protected]>

Regards
Aisheng

> ddr_perf_probe() misses to call ida_simple_remove() in an error path.
> Jump to cpuhp_state_err to fix it.
>
> Signed-off-by: Jing Xiangfeng <[email protected]>
> ---
> drivers/perf/fsl_imx8_ddr_perf.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/perf/fsl_imx8_ddr_perf.c b/drivers/perf/fsl_imx8_ddr_perf.c
> index 2bbb93188064..7b87aaf267d5 100644
> --- a/drivers/perf/fsl_imx8_ddr_perf.c
> +++ b/drivers/perf/fsl_imx8_ddr_perf.c
> @@ -705,8 +705,10 @@ static int ddr_perf_probe(struct platform_device
> *pdev)
>
> name = devm_kasprintf(&pdev->dev, GFP_KERNEL,
> DDR_PERF_DEV_NAME "%d",
> num);
> - if (!name)
> - return -ENOMEM;
> + if (!name) {
> + ret = -ENOMEM;
> + goto cpuhp_state_err;
> + }
>
> pmu->devtype_data = of_device_get_match_data(&pdev->dev);
>
> --
> 2.26.0.106.g9fadedd

2021-06-18 02:49:11

by Will Deacon

[permalink] [raw]
Subject: Re: [PATCH] drivers/perf: fix the missed ida_simple_remove() in ddr_perf_probe()

On Thu, 17 Jun 2021 20:26:14 +0800, Jing Xiangfeng wrote:
> ddr_perf_probe() misses to call ida_simple_remove() in an error path.
> Jump to cpuhp_state_err to fix it.

Applied to will (for-next/perf), thanks!

[1/1] drivers/perf: fix the missed ida_simple_remove() in ddr_perf_probe()
https://git.kernel.org/will/c/d96b1b8c9f79

Cheers,
--
Will

https://fixes.arm64.dev
https://next.arm64.dev
https://will.arm64.dev