Skip to contentSkip to conversation

greybus: arche-platform: Add missing of_node_put() in arche_platform_change_state()

PATCH In review Wei Yongjun 2 participants 2 messages Oct 17, 2016

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

PATCH 1/1 greybus: arche-platform: Add missing of_node_put() in arche_platform_change_state()

From: Wei Yongjun <[email protected]>

This node pointer is returned by of_find_compatible_node() with refcount incremented in this function. of_node_put() on it before exitting this function.

This is detected by Coccinelle semantic patch.

---
 drivers/staging/greybus/arche-platform.c | 1 +
 1 file changed, 1 insertion(+)
drivers/staging/greybus/arche-platform.c +1 -0
index a850f6b..389ed36 100644
@@ -128,6 +128,7 @@ int arche_platform_change_state(enum arche_platform_state state,
 	pdev = of_find_device_by_node(np);
 	if (!pdev) {
 		pr_err("arche-platform device not found\n");
+		of_node_put(np);
 		return -ENODEV;
 	}