Skip to content

Commit

Permalink
x86, UV: Correct failed topology memory leak
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
cpw@sgi.com authored and Ingo Molnar committed Jun 21, 2011
1 parent 442d392 commit bbd270e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions arch/x86/platform/uv/tlb_uv.c
Original file line number Diff line number Diff line change
Expand Up @@ -1797,15 +1797,20 @@ static int __init init_per_cpu(int nuvhubs, int base_part_pnode)
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;
}

/*
Expand Down

0 comments on commit bbd270e

Please sign in to comment.