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

Commit a05e2c37 authored by Konrad Rzeszutek Wilk's avatar Konrad Rzeszutek Wilk
Browse files

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: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
parent c9d76a24
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -434,11 +434,14 @@ void xen_teardown_timer(int cpu)
	struct clock_event_device *evt;
	BUG_ON(cpu == 0);
	evt = &per_cpu(xen_clock_events, cpu).evt;

	if (evt->irq >= 0) {
		unbind_from_irqhandler(evt->irq, 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)
{