mirror of
https://github.com/torvalds/linux
synced 2024-09-23 21:07:52 +00:00
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>
This commit is contained in:
parent
c9d76a24a2
commit
a05e2c371f
|
@ -434,10 +434,13 @@ void xen_teardown_timer(int cpu)
|
||||||
struct clock_event_device *evt;
|
struct clock_event_device *evt;
|
||||||
BUG_ON(cpu == 0);
|
BUG_ON(cpu == 0);
|
||||||
evt = &per_cpu(xen_clock_events, cpu).evt;
|
evt = &per_cpu(xen_clock_events, cpu).evt;
|
||||||
unbind_from_irqhandler(evt->irq, NULL);
|
|
||||||
evt->irq = -1;
|
if (evt->irq >= 0) {
|
||||||
kfree(per_cpu(xen_clock_events, cpu).name);
|
unbind_from_irqhandler(evt->irq, NULL);
|
||||||
per_cpu(xen_clock_events, cpu).name = NULL;
|
evt->irq = -1;
|
||||||
|
kfree(per_cpu(xen_clock_events, cpu).name);
|
||||||
|
per_cpu(xen_clock_events, cpu).name = NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void xen_setup_cpu_clockevents(void)
|
void xen_setup_cpu_clockevents(void)
|
||||||
|
|
Loading…
Reference in a new issue