diff mbox

[-next] video: fbdev: pxafb: add missing of_node_put() in of_get_pxafb_mode_info()

Message ID 1471078643-4815-1-git-send-email-weiyj.lk@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Wei Yongjun Aug. 13, 2016, 8:57 a.m. UTC
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(+)

--
To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Robert Jarzmik Aug. 13, 2016, 9:40 a.m. UTC | #1
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.
Tomi Valkeinen Aug. 30, 2016, 9:04 a.m. UTC | #2
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
diff mbox

Patch

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;
 	}