linux-fbdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] video: fbdev: pxafb: add missing of_node_put() in of_get_pxafb_mode_info()
@ 2016-08-13  8:57 Wei Yongjun
  2016-08-13  9:40 ` Robert Jarzmik
  2016-08-30  9:04 ` Tomi Valkeinen
  0 siblings, 2 replies; 3+ messages in thread
From: Wei Yongjun @ 2016-08-13  8:57 UTC (permalink / raw)
  To: linux-fbdev

This node pointer is returned by of_graph_get_next_endpoint() with
refcount incremented in this function. of_node_put() on it before
exitting this function.

Found by Coccinelle.

Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com>
---
 drivers/video/fbdev/pxafb.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/video/fbdev/pxafb.c b/drivers/video/fbdev/pxafb.c
index ed41fdb..ef73f14 100644
--- a/drivers/video/fbdev/pxafb.c
+++ b/drivers/video/fbdev/pxafb.c
@@ -2186,6 +2186,7 @@ static int of_get_pxafb_mode_info(struct device *dev,
 	ret = of_property_read_u32(np, "bus-width", &bus_width);
 	if (ret) {
 		dev_err(dev, "no bus-width specified: %d\n", ret);
+		of_node_put(np);
 		return ret;
 	}


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

* Re: [PATCH -next] video: fbdev: pxafb: add missing of_node_put() in of_get_pxafb_mode_info()
  2016-08-13  8:57 [PATCH -next] video: fbdev: pxafb: add missing of_node_put() in of_get_pxafb_mode_info() Wei Yongjun
@ 2016-08-13  9:40 ` Robert Jarzmik
  2016-08-30  9:04 ` Tomi Valkeinen
  1 sibling, 0 replies; 3+ messages in thread
From: Robert Jarzmik @ 2016-08-13  9:40 UTC (permalink / raw)
  To: linux-fbdev

Wei Yongjun <weiyj.lk@gmail.com> writes:

> This node pointer is returned by of_graph_get_next_endpoint() with
> refcount incremented in this function. of_node_put() on it before
> exitting this function.
>
> Found by Coccinelle.
>
> Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com>
Acked-by: Robert Jarzmik <robert.jarzmik@free.fr>

Cheers.

-- 
Robert

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

* Re: [PATCH -next] video: fbdev: pxafb: add missing of_node_put() in of_get_pxafb_mode_info()
  2016-08-13  8:57 [PATCH -next] video: fbdev: pxafb: add missing of_node_put() in of_get_pxafb_mode_info() Wei Yongjun
  2016-08-13  9:40 ` Robert Jarzmik
@ 2016-08-30  9:04 ` Tomi Valkeinen
  1 sibling, 0 replies; 3+ messages in thread
From: Tomi Valkeinen @ 2016-08-30  9:04 UTC (permalink / raw)
  To: linux-fbdev


[-- Attachment #1.1: Type: text/plain, Size: 861 bytes --]



On 13/08/16 11:57, Wei Yongjun wrote:
> This node pointer is returned by of_graph_get_next_endpoint() with
> refcount incremented in this function. of_node_put() on it before
> exitting this function.
> 
> Found by Coccinelle.
> 
> Signed-off-by: Wei Yongjun <weiyj.lk@gmail.com>
> ---
>  drivers/video/fbdev/pxafb.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/video/fbdev/pxafb.c b/drivers/video/fbdev/pxafb.c
> index ed41fdb..ef73f14 100644
> --- a/drivers/video/fbdev/pxafb.c
> +++ b/drivers/video/fbdev/pxafb.c
> @@ -2186,6 +2186,7 @@ static int of_get_pxafb_mode_info(struct device *dev,
>  	ret = of_property_read_u32(np, "bus-width", &bus_width);
>  	if (ret) {
>  		dev_err(dev, "no bus-width specified: %d\n", ret);
> +		of_node_put(np);
>  		return ret;
>  	}
> 

Thanks, queued for 4.9.

 Tomi


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

end of thread, other threads:[~2016-08-30  9:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-13  8:57 [PATCH -next] video: fbdev: pxafb: add missing of_node_put() in of_get_pxafb_mode_info() Wei Yongjun
2016-08-13  9:40 ` Robert Jarzmik
2016-08-30  9:04 ` Tomi Valkeinen

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