[<prev] [next>] [day] [month] [year] [list]
Message-Id: <E1QWsJT-0008GO-OJ@eag09.americas.sgi.com>
Date: Wed, 15 Jun 2011 10:47:27 -0500
From: Cliff Wickman <cpw@....com>
To: linux-kernel@...r.kernel.org
Cc: mingo@...e.hu
Subject: [PATCH 7/8 v2] x86, UV: correct failed topology memory leak
From: Cliff Wickman <cpw@....com>
Fix a memory leak in init_per_cpu() when the topology checks fail.
The leak should never occur in practice. It would only occur in an
unexpected topology that would make the BAU unuseable as a result.
Diffed against 3.0.0-rc3
Signed-off-by: Cliff Wickman <cpw@....com>
---
arch/x86/platform/uv/tlb_uv.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
Index: linux/arch/x86/platform/uv/tlb_uv.c
===================================================================
--- linux.orig/arch/x86/platform/uv/tlb_uv.c
+++ linux/arch/x86/platform/uv/tlb_uv.c
@@ -1798,15 +1798,20 @@ static int __init init_per_cpu(int nuvhu
uvhub_mask = kzalloc((nuvhubs+7)/8, GFP_KERNEL);
if (get_cpu_topology(base_part_pnode, uvhub_descs, uvhub_mask))
- return 1;
+ goto fail;
if (summarize_uvhub_sockets(nuvhubs, uvhub_descs, uvhub_mask))
- return 1;
+ goto fail;
kfree(uvhub_descs);
kfree(uvhub_mask);
init_per_cpu_tunables();
return 0;
+
+fail:
+ kfree(uvhub_descs);
+ kfree(uvhub_mask);
+ return 1;
}
/*
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists