Skip to contentSkip to conversation

drm/logicvc: add missing of_node_put() in logicvc_layers_init()

PATCH Applied Yang Yingliang 2 participants 3 messages Jun 14, 2022 – Jun 24, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/logicvc: add missing of_node_put() in logicvc_layers_init()

The of_node_put() need be called in error path in logicvc_layers_init().

Fixes efeeaefe9be5 ("drm: Add support for the LogiCVC display controller")
---
 drivers/gpu/drm/logicvc/logicvc_layer.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/logicvc/logicvc_layer.c +4 -1
index bae1c7f99569..00a37563a6dc 100644
@@ -610,8 +610,11 @@ int logicvc_layers_init(struct logicvc_drm *logicvc)
 		}
 
 		ret = logicvc_layer_init(logicvc, layer_node, index);
-		if (ret)
+		if (ret) {
+			of_node_put(layer_node);
+			of_node_put(layers_node);
 			goto error;
+		}
 
 		of_node_put(layer_node);
 	}
Signature · 1 line
2.25.1
Acked-by on v1 1/1
#1 lore raw

Hi Yang,

Quoted 5 lines · Yang Yingliang

The of_node_put() need be called in error path in logicvc_layers_init().

Fixes efeeaefe9be5 ("drm: Add support for the LogiCVC display controller")

Thanks for the fix!

Cheers,

Paul

Quoted 24 lines
---
 drivers/gpu/drm/logicvc/logicvc_layer.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/logicvc/logicvc_layer.c +4 -1
index bae1c7f99569..00a37563a6dc 100644
@@ -610,8 +610,11 @@ int logicvc_layers_init(struct logicvc_drm *logicvc)
 		}
 
 		ret = logicvc_layer_init(logicvc, layer_node, index);
-		if (ret)
+		if (ret) {
+			of_node_put(layer_node);
+			of_node_put(layers_node);
 			goto error;
+		}
 
 		of_node_put(layer_node);
 	}
Signature · 1 line
2.25.1
Signature · 3 lines
Paul Kocialkowski, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com
#2 lore raw

Hi,

Quoted 5 lines · Paul Kocialkowski

Hi Yang,

Quoted 2 lines · Yang Yingliang

The of_node_put() need be called in error path in logicvc_layers_init().

Quoted 7 lines
Quoted 3 lines
Fixes efeeaefe9be5 ("drm: Add support for the LogiCVC display controller")

Thanks for the fix!

Adapted this after Julia's patch: Only the put on layers_node is required on error condition.

Pushed to drm-misc-next, thanks!

Paul

Quoted 29 lines
Quoted 24 lines
---
 drivers/gpu/drm/logicvc/logicvc_layer.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/logicvc/logicvc_layer.c +4 -1
index bae1c7f99569..00a37563a6dc 100644
@@ -610,8 +610,11 @@ int logicvc_layers_init(struct logicvc_drm *logicvc)
 		}
 
 		ret = logicvc_layer_init(logicvc, layer_node, index);
-		if (ret)
+		if (ret) {
+			of_node_put(layer_node);
+			of_node_put(layers_node);
 			goto error;
+		}
 
 		of_node_put(layer_node);
 	}
Signature · 1 line
2.25.1
Signature · 3 lines
Paul Kocialkowski, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com
Signature · 3 lines
Paul Kocialkowski, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com