[PATCH] drm: logicvc: fix device_node refcount leak in logicvc_layers_init()

Manush Prajwal <[email protected]>
Newsgroups org.freedesktop.lists.dri-devel
Message-ID <[email protected]>
On logicvc_layer_init() failure, logicvc_layers_init() releases the
parent layers_node reference before jumping to the error path, but
never releases layer_node, the child node held by the current
for_each_child_of_node() iteration. Add the missing of_node_put()
for layer_node alongside the existing one for layers_node.

Signed-off-by: Manush Prajwal <[email protected]>
---
 drivers/gpu/drm/logicvc/logicvc_layer.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/logicvc/logicvc_layer.c b/drivers/gpu/drm/logicvc/logicvc_layer.c
index 7f5ba00018..e83a2aafed 100644
--- a/drivers/gpu/drm/logicvc/logicvc_layer.c
+++ b/drivers/gpu/drm/logicvc/logicvc_layer.c
@@ -613,6 +613,7 @@ int logicvc_layers_init(struct logicvc_drm *logicvc)
 
 		ret = logicvc_layer_init(logicvc, layer_node, index);
 		if (ret) {
+			of_node_put(layer_node);
 			of_node_put(layers_node);
 			goto error;
 		}
-- 
2.46.2.windows.1
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.