diff options
author | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2013-06-04 17:11:52 -0400 |
---|---|---|
committer | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2013-06-10 08:43:36 -0400 |
commit | a05e2c371fbe73403793d126ceab93787cb4afd4 (patch) | |
tree | 219dca44fab19e9e829c9df10a0bf4af5fb32bef /arch/x86/xen | |
parent | c9d76a24a28917c1ef6833f40c4ceff2e81b3ebb (diff) |
xen/time: Check that the per_cpu data structure has data before freeing.
We don't check whether the per_cpu data structure has actually
been freed in the past. This checks it and if it has been freed
in the past then just continues on without double-freeing.
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Diffstat (limited to 'arch/x86/xen')
-rw-r--r-- | arch/x86/xen/time.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/arch/x86/xen/time.c b/arch/x86/xen/time.c index 011f1bf85765..6a56ae092994 100644 --- a/arch/x86/xen/time.c +++ b/arch/x86/xen/time.c | |||
@@ -434,10 +434,13 @@ void xen_teardown_timer(int cpu) | |||
434 | struct clock_event_device *evt; | 434 | struct clock_event_device *evt; |
435 | BUG_ON(cpu == 0); | 435 | BUG_ON(cpu == 0); |
436 | evt = &per_cpu(xen_clock_events, cpu).evt; | 436 | evt = &per_cpu(xen_clock_events, cpu).evt; |
437 | unbind_from_irqhandler(evt->irq, NULL); | 437 | |
438 | evt->irq = -1; | 438 | if (evt->irq >= 0) { |
439 | kfree(per_cpu(xen_clock_events, cpu).name); | 439 | unbind_from_irqhandler(evt->irq, NULL); |
440 | per_cpu(xen_clock_events, cpu).name = NULL; | 440 | evt->irq = -1; |
441 | kfree(per_cpu(xen_clock_events, cpu).name); | ||
442 | per_cpu(xen_clock_events, cpu).name = NULL; | ||
443 | } | ||
441 | } | 444 | } |
442 | 445 | ||
443 | void xen_setup_cpu_clockevents(void) | 446 | void xen_setup_cpu_clockevents(void) |