lkml.org 
[lkml]   [2011]   [Jun]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[patch 7/8 v5] x86, UV: correct failed topology memory leak
Fix a memory leak in init_per_cpu() when the topology check fails.

Signed-off-by: Cliff Wickman <cpw@sgi.com>
---

The leak should never occur after development. It would only occur in an
unexpected topology that would make the BAU unuseable as a result.

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
@@ -1797,15 +1797,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;
}

/*


\
 
 \ /
  Last update: 2011-06-21 14:27    [W:0.066 / U:0.260 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site