summary refs log tree commit diff
path: root/drivers/of
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/of')
-rw-r--r--drivers/of/base.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/of/base.c b/drivers/of/base.c
index d4bea3c797d6..ce8206f9f97a 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -842,8 +842,11 @@ struct device_node *of_find_node_opts_by_path(const char *path, const char **opt
 	if (!np)
 		np = of_node_get(of_root);
 	while (np && *path == '/') {
+		struct device_node *tmp = np;
+
 		path++; /* Increment past '/' delimiter */
 		np = __of_find_node_by_path(np, path);
+		of_node_put(tmp);
 		path = strchrnul(path, '/');
 		if (separator && separator < path)
 			break;