2021-06-17 13:23:57

by Zou Wei

[permalink] [raw]
Subject: [PATCH -next] scsi: ufs-mediatek: Add missing of_node_put() in ufs_mtk_probe()

The function is missing a of_node_put on node, fix this by adding the call
before returning.

Reported-by: Hulk Robot <[email protected]>
Signed-off-by: Zou Wei <[email protected]>
---
drivers/scsi/ufs/ufs-mediatek.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/scsi/ufs/ufs-mediatek.c b/drivers/scsi/ufs/ufs-mediatek.c
index 1a517c9..d2c2516 100644
--- a/drivers/scsi/ufs/ufs-mediatek.c
+++ b/drivers/scsi/ufs/ufs-mediatek.c
@@ -1120,6 +1120,7 @@ static int ufs_mtk_probe(struct platform_device *pdev)
if (err)
dev_info(dev, "probe failed %d\n", err);

+ of_node_put(reset_node);
return err;
}

--
2.6.2


2021-06-18 03:23:27

by Stanley Chu

[permalink] [raw]
Subject: Re: [PATCH -next] scsi: ufs-mediatek: Add missing of_node_put() in ufs_mtk_probe()

Hi Zou,

On Thu, 2021-06-17 at 19:32 +0800, Zou Wei wrote:
> The function is missing a of_node_put on node, fix this by adding the call
> before returning.
>
> Reported-by: Hulk Robot <[email protected]>
> Signed-off-by: Zou Wei <[email protected]>
> ---
> drivers/scsi/ufs/ufs-mediatek.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/scsi/ufs/ufs-mediatek.c b/drivers/scsi/ufs/ufs-mediatek.c
> index 1a517c9..d2c2516 100644
> --- a/drivers/scsi/ufs/ufs-mediatek.c
> +++ b/drivers/scsi/ufs/ufs-mediatek.c
> @@ -1120,6 +1120,7 @@ static int ufs_mtk_probe(struct platform_device *pdev)
> if (err)
> dev_info(dev, "probe failed %d\n", err);
>
> + of_node_put(reset_node);
> return err;
> }
>

Thanks for this fix.

Reviewed-by: Stanley Chu <[email protected]>

2021-06-19 09:06:11

by Martin K. Petersen

[permalink] [raw]
Subject: Re: [PATCH -next] scsi: ufs-mediatek: Add missing of_node_put() in ufs_mtk_probe()


Zou,

> The function is missing a of_node_put on node, fix this by adding the
> call before returning.

Applied to 5.14/scsi-staging, thanks!

--
Martin K. Petersen Oracle Linux Engineering