Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1592512

[PATCH v3 2/2] ARM: OMAP2+: Release device node after it is no longer needed.

From Guenter Roeck <linux@roeck-us.net>
Newsgroups linux.kernel
Subject [PATCH v3 2/2] ARM: OMAP2+: Release device node after it is no longer needed.
Date 2017-03-04 16:10 +0100
Message-ID <thjtN-2xJ-37@gated-at.bofh.it> (permalink)
References <thjtM-2xJ-25@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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>
---
v3: Split patch into two parts

 arch/arm/mach-omap2/omap_hwmod_3xxx_data.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
index 44b5f9bbdde6..042e460f4aa4 100644
--- a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
@@ -3193,15 +3193,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
-- 
2.7.4

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v3 1/2] ARM: OMAP2+: Fix device node reference counts Guenter Roeck <linux@roeck-us.net> - 2017-03-04 16:10 +0100
  [PATCH v3 2/2] ARM: OMAP2+: Release device node after it is no longer needed. Guenter Roeck <linux@roeck-us.net> - 2017-03-04 16:10 +0100
  Re: [PATCH v3 1/2] ARM: OMAP2+: Fix device node reference counts Tony Lindgren <tony@atomide.com> - 2017-03-04 18:00 +0100

csiph-web