gpu: drm: omapdrm: dss-of: add missing of_node_put after calling of_parse_phandle
authorPeter Chen <peter.chen@nxp.com>
Fri, 15 Jul 2016 03:17:03 +0000 (11:17 +0800)
committerSean Paul <seanpaul@chromium.org>
Fri, 15 Jul 2016 12:47:01 +0000 (08:47 -0400)
of_node_put needs to be called when the device node which is got
from of_parse_phandle has finished using.

Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
Signed-off-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
drivers/gpu/drm/omapdrm/dss/dss-of.c

index dfd4e9621e3b1c969b76ac6873a480a163d98959..e256d879b25ccc379cf93201b155f31e00269af2 100644 (file)
@@ -125,15 +125,16 @@ u32 dss_of_port_get_port_number(struct device_node *port)
 
 static struct device_node *omapdss_of_get_remote_port(const struct device_node *node)
 {
-       struct device_node *np;
+       struct device_node *np, *np_parent;
 
        np = of_parse_phandle(node, "remote-endpoint", 0);
        if (!np)
                return NULL;
 
-       np = of_get_next_parent(np);
+       np_parent = of_get_next_parent(np);
+       of_node_put(np);
 
-       return np;
+       return np_parent;
 }
 
 struct device_node *