From: Andrew Morton Date: Wed, 20 Feb 2013 02:14:20 +0000 (+1100) Subject: memory-hotplug-do-not-allocate-pdgat-if-it-was-not-freed-when-offline-fix-fix X-Git-Tag: next-20130220~1^2~524 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=4558c652ccf025ba50f1dfb67840df3ce977b347;p=karo-tx-linux.git memory-hotplug-do-not-allocate-pdgat-if-it-was-not-freed-when-offline-fix-fix fix the warning again again Tested-by: Wu Fengguang Cc: Tang Chen Signed-off-by: Andrew Morton --- diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index c806abd78d0e..559e4409cf90 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c @@ -1089,7 +1089,10 @@ int __ref add_memory(int nid, u64 start, u64 size) if (!res) goto out; - new_pgdat = (NODE_DATA(nid) == NULL); + { /* Stupid hack to suppress address-never-null warning */ + void *p = NODE_DATA(nid); + new_pgdat = !p; + } new_node = !node_online(nid); if (new_node) { pgdat = hotadd_new_pgdat(nid, start);