Skip to contentSkip to conversation

gpu: drm: msm_drv: add missing of_node_put after calling of_parse_phandle

PATCH New Peter Chen 1 participant 1 message Jul 4, 2016

Subsystems (3)
lore
Share & tools
lore

Peter Chen

author
#0 lore raw

PATCH v2 1/1 gpu: drm: msm_drv: add missing of_node_put after calling of_parse_phandle

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

---
Changes for v2:
- There are two missings in the code, handle it both in one patch

 drivers/gpu/drm/msm/msm_drv.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/gpu/drm/msm/msm_drv.c +2 -0
index 9c65409..46c6037 100644
@@ -284,6 +284,7 @@ static int msm_init_vram(struct drm_device *dev)
 	if (node) {
 		struct resource r;
 		ret = of_address_to_resource(node, 0, &r);
+		of_node_put(node);
 		if (ret)
 			return ret;
 		size = r.end - r.start;
@@ -819,6 +820,7 @@ static int add_components(struct device *dev, struct component_match **matchptr,
 			break;
 
 		component_match_add(dev, matchptr, compare_of, node);
+		of_node_put(node);
 	}
 
 	return 0;
Signature · 1 line
1.9.1