dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] video: fbdev:  Fix missing of_node_put in imxfb_probe
@ 2022-04-07  9:01 cgel.zte
  2022-04-07 19:41 ` Helge Deller
  0 siblings, 1 reply; 2+ messages in thread
From: cgel.zte @ 2022-04-07  9:01 UTC (permalink / raw)
  To: s.hauer, kernel
  Cc: linux-fbdev, shawnguo, deller, Zeal Robot, linux-kernel,
	dri-devel, linux-imx, Lv Ruyi, linux-arm-kernel

From: Lv Ruyi <lv.ruyi@zte.com.cn>

of_parse_phandle returns node pointer with refcount incremented,
use of_node_put() on it when done.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn>
---
 drivers/video/fbdev/imxfb.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/video/fbdev/imxfb.c b/drivers/video/fbdev/imxfb.c
index 68288756ffff..a2f644c97f28 100644
--- a/drivers/video/fbdev/imxfb.c
+++ b/drivers/video/fbdev/imxfb.c
@@ -925,10 +925,12 @@ static int imxfb_probe(struct platform_device *pdev)
 				sizeof(struct imx_fb_videomode), GFP_KERNEL);
 		if (!fbi->mode) {
 			ret = -ENOMEM;
+			of_node_put(display_np);
 			goto failed_of_parse;
 		}
 
 		ret = imxfb_of_read_mode(&pdev->dev, display_np, fbi->mode);
+		of_node_put(display_np);
 		if (ret)
 			goto failed_of_parse;
 	}
-- 
2.25.1


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

* Re: [PATCH] video: fbdev: Fix missing of_node_put in imxfb_probe
  2022-04-07  9:01 [PATCH] video: fbdev: Fix missing of_node_put in imxfb_probe cgel.zte
@ 2022-04-07 19:41 ` Helge Deller
  0 siblings, 0 replies; 2+ messages in thread
From: Helge Deller @ 2022-04-07 19:41 UTC (permalink / raw)
  To: cgel.zte, s.hauer, kernel
  Cc: linux-fbdev, shawnguo, Lv Ruyi, linux-kernel, dri-devel,
	linux-imx, Zeal Robot, linux-arm-kernel

On 4/7/22 11:01, cgel.zte@gmail.com wrote:
> From: Lv Ruyi <lv.ruyi@zte.com.cn>
>
> of_parse_phandle returns node pointer with refcount incremented,
> use of_node_put() on it when done.
>
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn>

applied.
Thanks!
Helge

> ---
>  drivers/video/fbdev/imxfb.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/video/fbdev/imxfb.c b/drivers/video/fbdev/imxfb.c
> index 68288756ffff..a2f644c97f28 100644
> --- a/drivers/video/fbdev/imxfb.c
> +++ b/drivers/video/fbdev/imxfb.c
> @@ -925,10 +925,12 @@ static int imxfb_probe(struct platform_device *pdev)
>  				sizeof(struct imx_fb_videomode), GFP_KERNEL);
>  		if (!fbi->mode) {
>  			ret = -ENOMEM;
> +			of_node_put(display_np);
>  			goto failed_of_parse;
>  		}
>
>  		ret = imxfb_of_read_mode(&pdev->dev, display_np, fbi->mode);
> +		of_node_put(display_np);
>  		if (ret)
>  			goto failed_of_parse;
>  	}


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

end of thread, other threads:[~2022-04-07 19:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-07  9:01 [PATCH] video: fbdev: Fix missing of_node_put in imxfb_probe cgel.zte
2022-04-07 19:41 ` Helge Deller

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).