From: Wen Congyang Date: Wed, 11 Jul 2012 21:02:31 +0000 (-0700) Subject: mm/memory_hotplug.c: release memory resources if hotadd_new_pgdat() fails X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=41b9e2d7ec3f618fd076cb3466edd0a8ebabae5a;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git mm/memory_hotplug.c: release memory resources if hotadd_new_pgdat() fails We should goto error to release memory resource if hotadd_new_pgdat() failed. Signed-off-by: Wen Congyang Cc: Yasuaki ISIMATU Acked-by: David Rientjes Cc: Len Brown Cc: "Brown, Len" Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index 0d7e3ec8e0f3..427bb291dd0f 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c @@ -618,7 +618,7 @@ int __ref add_memory(int nid, u64 start, u64 size) pgdat = hotadd_new_pgdat(nid, start); ret = -ENOMEM; if (!pgdat) - goto out; + goto error; new_pgdat = 1; }