[PATCH 2/7] gpu: drm: sti_compositor: add missing of_node_put after calling of_parse_phandle

Peter Chen peter.chen at nxp.com
Tue Jul 5 02:04:49 UTC 2016


of_node_put needs to be called when the device node which is got
from of_parse_phandle has finished using.

Cc: Benjamin Gaignard <benjamin.gaignard at linaro.org>
Cc: Vincent Abriou <vincent.abriou at st.com>
Signed-off-by: Peter Chen <peter.chen at nxp.com>
---
 drivers/gpu/drm/sti/sti_compositor.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/sti/sti_compositor.c b/drivers/gpu/drm/sti/sti_compositor.c
index 3d2fa3a..064de14 100644
--- a/drivers/gpu/drm/sti/sti_compositor.c
+++ b/drivers/gpu/drm/sti/sti_compositor.c
@@ -247,10 +247,12 @@ static int sti_compositor_probe(struct platform_device *pdev)
 	vtg_np = of_parse_phandle(pdev->dev.of_node, "st,vtg", 0);
 	if (vtg_np)
 		compo->vtg_main = of_vtg_find(vtg_np);
+	of_node_put(vtg_np);
 
 	vtg_np = of_parse_phandle(pdev->dev.of_node, "st,vtg", 1);
 	if (vtg_np)
 		compo->vtg_aux = of_vtg_find(vtg_np);
+	of_node_put(vtg_np);
 
 	platform_set_drvdata(pdev, compo);
 
-- 
1.9.1



More information about the dri-devel mailing list