From: Anton Blanchard <anton@samba•org>
To: benh@kernel•crashing.org, paulus@samba•org, sfr@ozlabs•org,
nfont@austin•ibm.com
Cc: linuxppc-dev@lists•ozlabs.org
Subject: [PATCH 1/4] [PATCH] powerpc: numa: Remove double of_node_put in hot_add_node_scn_to_nid
Date: Thu, 11 Aug 2011 16:44:21 +1000 [thread overview]
Message-ID: <20110811064427.515781037@samba.org> (raw)
During memory hotplug testing, I got the following warning:
ERROR: Bad of_node_put() on /memory@0
of_node_release
kref_put
of_node_put
of_find_node_by_type
hot_add_node_scn_to_nid
hot_add_scn_to_nid
memory_add_physaddr_to_nid
...
of_find_node_by_type() loop does the of_node_put for us so we only
need the handle the case where we terminate the loop early.
As suggested by Stephen Rothwell we can do the of_node_put
unconditionally outside of the loop since of_node_put handles a
NULL argument fine.
Signed-off-by: Anton Blanchard <anton@samba•org>
Cc: stable@kernel•org
---
Index: linux-powerpc/arch/powerpc/mm/numa.c
===================================================================
--- linux-powerpc.orig/arch/powerpc/mm/numa.c 2011-06-06 08:07:35.148708089 +1000
+++ linux-powerpc/arch/powerpc/mm/numa.c 2011-08-11 09:07:07.329584634 +1000
@@ -1214,11 +1214,12 @@ int hot_add_node_scn_to_nid(unsigned lon
break;
}
- of_node_put(memory);
if (nid >= 0)
break;
}
+ of_node_put(memory);
+
return nid;
}
next reply other threads:[~2011-08-11 6:44 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-11 6:44 Anton Blanchard [this message]
2011-08-11 6:44 ` [PATCH 2/4] [PATCH] powerpc: Use for_each_node_by_type instead of open coding it Anton Blanchard
2011-08-11 6:44 ` [PATCH 3/4] [PATCH] powerpc: Coding style cleanups Anton Blanchard
2011-08-11 6:44 ` [PATCH 4/4] powerpc: Fix oops when echoing bad values to /sys/devices/system/memory/probe Anton Blanchard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110811064427.515781037@samba.org \
--to=anton@samba$(echo .)org \
--cc=benh@kernel$(echo .)crashing.org \
--cc=linuxppc-dev@lists$(echo .)ozlabs.org \
--cc=nfont@austin$(echo .)ibm.com \
--cc=paulus@samba$(echo .)org \
--cc=sfr@ozlabs$(echo .)org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox