linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] scsi: ufs: ufs-mediatek: add put_device() after of_find_device_by_node()
@ 2021-11-10 10:51 cgel.zte
  2021-11-11  5:41 ` Peter Wang
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: cgel.zte @ 2021-11-10 10:51 UTC (permalink / raw)
  To: stanley.chu
  Cc: alim.akhtar, avri.altman, jejb, martin.petersen, matthias.bgg,
	linux-scsi, linux-mediatek, linux-kernel, linux-arm-kernel,
	Ye Guojin, Zeal Robot

From: Ye Guojin <ye.guojin@zte.com.cn>

This was found by coccicheck:
./drivers/scsi/ufs/ufs-mediatek.c, 211, 1-7, ERROR missing put_device;
call of_find_device_by_node on line 1185, but without a corresponding
object release within this function.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Ye Guojin <ye.guojin@zte.com.cn>
---
 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 fc5b214347b3..5393b5c9dd9c 100644
--- a/drivers/scsi/ufs/ufs-mediatek.c
+++ b/drivers/scsi/ufs/ufs-mediatek.c
@@ -1189,6 +1189,7 @@ static int ufs_mtk_probe(struct platform_device *pdev)
 	}
 	link = device_link_add(dev, &reset_pdev->dev,
 		DL_FLAG_AUTOPROBE_CONSUMER);
+	put_device(&reset_pdev->dev);
 	if (!link) {
 		dev_notice(dev, "add reset device_link fail\n");
 		goto skip_reset;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] scsi: ufs: ufs-mediatek: add put_device() after of_find_device_by_node()
  2021-11-10 10:51 [PATCH] scsi: ufs: ufs-mediatek: add put_device() after of_find_device_by_node() cgel.zte
@ 2021-11-11  5:41 ` Peter Wang
  2021-11-11  5:52 ` Peter Wang
  2021-11-19  4:16 ` Martin K. Petersen
  2 siblings, 0 replies; 4+ messages in thread
From: Peter Wang @ 2021-11-11  5:41 UTC (permalink / raw)
  To: cgel.zte, stanley.chu
  Cc: alim.akhtar, avri.altman, jejb, martin.petersen, matthias.bgg,
	linux-scsi, linux-mediatek, linux-kernel, linux-arm-kernel,
	Ye Guojin, Zeal Robot


On 11/10/21 6:51 PM, cgel.zte@gmail.com wrote:
> From: Ye Guojin <ye.guojin@zte.com.cn>
>
> This was found by coccicheck:
> ./drivers/scsi/ufs/ufs-mediatek.c, 211, 1-7, ERROR missing put_device;
> call of_find_device_by_node on line 1185, but without a corresponding
> object release within this function.
>
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: Ye Guojin <ye.guojin@zte.com.cn>
> ---
>   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 fc5b214347b3..5393b5c9dd9c 100644
> --- a/drivers/scsi/ufs/ufs-mediatek.c
> +++ b/drivers/scsi/ufs/ufs-mediatek.c
> @@ -1189,6 +1189,7 @@ static int ufs_mtk_probe(struct platform_device *pdev)
>   	}
>   	link = device_link_add(dev, &reset_pdev->dev,
>   		DL_FLAG_AUTOPROBE_CONSUMER);
> +	put_device(&reset_pdev->dev);

Thanks for fix this missing.
Reviewed-by: Peter Wang <peter.wang@mediatek.com>

>   	if (!link) {
>   		dev_notice(dev, "add reset device_link fail\n");
>   		goto skip_reset;

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] scsi: ufs: ufs-mediatek: add put_device() after of_find_device_by_node()
  2021-11-10 10:51 [PATCH] scsi: ufs: ufs-mediatek: add put_device() after of_find_device_by_node() cgel.zte
  2021-11-11  5:41 ` Peter Wang
@ 2021-11-11  5:52 ` Peter Wang
  2021-11-19  4:16 ` Martin K. Petersen
  2 siblings, 0 replies; 4+ messages in thread
From: Peter Wang @ 2021-11-11  5:52 UTC (permalink / raw)
  To: cgel.zte, stanley.chu
  Cc: alim.akhtar, avri.altman, jejb, martin.petersen, matthias.bgg,
	linux-scsi, linux-mediatek, linux-kernel, linux-arm-kernel,
	Ye Guojin, Zeal Robot


On 11/10/21 6:51 PM, cgel.zte@gmail.com wrote:
> From: Ye Guojin <ye.guojin@zte.com.cn>
>
> This was found by coccicheck:
> ./drivers/scsi/ufs/ufs-mediatek.c, 211, 1-7, ERROR missing put_device;
> call of_find_device_by_node on line 1185, but without a corresponding
> object release within this function.
>
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: Ye Guojin <ye.guojin@zte.com.cn>
> ---
>   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 fc5b214347b3..5393b5c9dd9c 100644
> --- a/drivers/scsi/ufs/ufs-mediatek.c
> +++ b/drivers/scsi/ufs/ufs-mediatek.c
> @@ -1189,6 +1189,7 @@ static int ufs_mtk_probe(struct platform_device *pdev)
>   	}
>   	link = device_link_add(dev, &reset_pdev->dev,
>   		DL_FLAG_AUTOPROBE_CONSUMER);
> +	put_device(&reset_pdev->dev);


Thanks for fix this missing.
Reviewed-by: Peter Wang <peter.wang@mediatek.com>


>   	if (!link) {
>   		dev_notice(dev, "add reset device_link fail\n");
>   		goto skip_reset;

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] scsi: ufs: ufs-mediatek: add put_device() after of_find_device_by_node()
  2021-11-10 10:51 [PATCH] scsi: ufs: ufs-mediatek: add put_device() after of_find_device_by_node() cgel.zte
  2021-11-11  5:41 ` Peter Wang
  2021-11-11  5:52 ` Peter Wang
@ 2021-11-19  4:16 ` Martin K. Petersen
  2 siblings, 0 replies; 4+ messages in thread
From: Martin K. Petersen @ 2021-11-19  4:16 UTC (permalink / raw)
  To: cgel.zte, stanley.chu
  Cc: Martin K . Petersen, Ye Guojin, linux-mediatek, alim.akhtar,
	jejb, matthias.bgg, linux-arm-kernel, Zeal Robot, avri.altman,
	linux-scsi, linux-kernel

On Wed, 10 Nov 2021 10:51:33 +0000, cgel.zte@gmail.com wrote:

> From: Ye Guojin <ye.guojin@zte.com.cn>
> 
> This was found by coccicheck:
> ./drivers/scsi/ufs/ufs-mediatek.c, 211, 1-7, ERROR missing put_device;
> call of_find_device_by_node on line 1185, but without a corresponding
> object release within this function.
> 
> [...]

Applied to 5.16/scsi-fixes, thanks!

[1/1] scsi: ufs: ufs-mediatek: add put_device() after of_find_device_by_node()
      https://git.kernel.org/mkp/scsi/c/cc03facb1c42

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-11-19  4:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-10 10:51 [PATCH] scsi: ufs: ufs-mediatek: add put_device() after of_find_device_by_node() cgel.zte
2021-11-11  5:41 ` Peter Wang
2021-11-11  5:52 ` Peter Wang
2021-11-19  4:16 ` Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).