aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
authorcpw@sgi.com <cpw@sgi.com>2011-06-21 08:21:32 -0400
committerIngo Molnar <mingo@elte.hu>2011-06-21 08:50:33 -0400
commitbbd270e6f45a5ca30e1d3b6133c516a9dc9dd6c0 (patch)
tree7789cc0b3ac3bd5e34fc2eb493cac2a9d1d26306 /arch/x86
parent442d3924926c62741912d8a930220af253922007 (diff)
x86, UV: Correct failed topology memory leak
Fix a memory leak in init_per_cpu() when the topology check fails. The leak should never occur on deployed systems. It would only occur in an unexpected topology that would make the BAU unuseable as a result. Signed-off-by: Cliff Wickman <cpw@sgi.com> Link: http://lkml.kernel.org/r/20110621122242.981533045@sgi.com Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/platform/uv/tlb_uv.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/arch/x86/platform/uv/tlb_uv.c b/arch/x86/platform/uv/tlb_uv.c
index 5265842b8d0b..db8b915f54bc 100644
--- a/arch/x86/platform/uv/tlb_uv.c
+++ b/arch/x86/platform/uv/tlb_uv.c
@@ -1797,15 +1797,20 @@ static int __init init_per_cpu(int nuvhubs, int base_part_pnode)
1797 uvhub_mask = kzalloc((nuvhubs+7)/8, GFP_KERNEL); 1797 uvhub_mask = kzalloc((nuvhubs+7)/8, GFP_KERNEL);
1798 1798
1799 if (get_cpu_topology(base_part_pnode, uvhub_descs, uvhub_mask)) 1799 if (get_cpu_topology(base_part_pnode, uvhub_descs, uvhub_mask))
1800 return 1; 1800 goto fail;
1801 1801
1802 if (summarize_uvhub_sockets(nuvhubs, uvhub_descs, uvhub_mask)) 1802 if (summarize_uvhub_sockets(nuvhubs, uvhub_descs, uvhub_mask))
1803 return 1; 1803 goto fail;
1804 1804
1805 kfree(uvhub_descs); 1805 kfree(uvhub_descs);
1806 kfree(uvhub_mask); 1806 kfree(uvhub_mask);
1807 init_per_cpu_tunables(); 1807 init_per_cpu_tunables();
1808 return 0; 1808 return 0;
1809
1810fail:
1811 kfree(uvhub_descs);
1812 kfree(uvhub_mask);
1813 return 1;
1809} 1814}
1810 1815
1811/* 1816/*