xen/timers: Fix memory leak with cpu unplug/plug (take 2)
authorAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 23 Apr 2019 15:18:29 +0000 (16:18 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 13 May 2019 09:35:37 +0000 (10:35 +0100)
commite978e9ed9e1ff0dc326e72708ed03cac2ba41db8
tree4039d3ad94347071dcfaaa2dbafedfc35cc0730c
parent3431a62ae851116518b84ce91c1572edbbfc7d92
xen/timers: Fix memory leak with cpu unplug/plug (take 2)

Previous attempts to fix this leak didn't identify the root cause, and
ultimately failed.  The cause is actually the CPU_UP_PREPARE case
(re)initialising ts->heap back to dummy_heap, which leaks the previous
allocation.

Rearrange the logic to only initialise ts once.  This also avoids the
redundant (but benign, due to ts->inactive always being empty) initialising of
the other ts fields.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/common/timer.c