Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bbd270e6 authored by cpw@sgi.com's avatar cpw@sgi.com Committed by Ingo Molnar
Browse files

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: default avatarCliff Wickman <cpw@sgi.com>
Link: http://lkml.kernel.org/r/20110621122242.981533045@sgi.com


Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 442d3924
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -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;
}

/*