ARM: OMAP2+: Release device node after it is no longer needed.
authorGuenter Roeck <linux@roeck-us.net>
Sat, 4 Mar 2017 15:02:11 +0000 (07:02 -0800)
committerTony Lindgren <tony@atomide.com>
Sat, 4 Mar 2017 16:27:50 +0000 (08:27 -0800)
The device node returned by of_find_node_by_name() needs to be released
after it is no longer needed to avoid a device node leak.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Tony Lindgren <tony@atomide.com>
arch/arm/mach-omap2/omap_hwmod_3xxx_data.c

index 0fa08c1e4701ca0595fc04dc993be6de74e66a03..1435fee39a89ba18239291859c97f0f333ca877f 100644 (file)
@@ -3213,15 +3213,20 @@ int __init omap3xxx_hwmod_init(void)
 
        if (h_sham && omap3xxx_hwmod_is_hs_ip_block_usable(bus, "sham")) {
                r = omap_hwmod_register_links(h_sham);
-               if (r < 0)
+               if (r < 0) {
+                       of_node_put(bus);
                        return r;
+               }
        }
 
        if (h_aes && omap3xxx_hwmod_is_hs_ip_block_usable(bus, "aes")) {
                r = omap_hwmod_register_links(h_aes);
-               if (r < 0)
+               if (r < 0) {
+                       of_node_put(bus);
                        return r;
+               }
        }
+       of_node_put(bus);
 
        /*
         * Register hwmod links specific to certain ES levels of a