From: Thomas Gleixner Date: Fri, 2 Dec 2011 15:02:45 +0000 (+0100) Subject: clockevents: Set noop handler in clockevents_exchange_device() X-Git-Tag: firefly_0821_release~3680^2~4005^2 X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=de28f25e8244c7353abed8de0c7792f5f883588c;p=firefly-linux-kernel-4.4.55.git clockevents: Set noop handler in clockevents_exchange_device() If a device is shutdown, then there might be a pending interrupt, which will be processed after we reenable interrupts, which causes the original handler to be run. If the old handler is the (broadcast) periodic handler the shutdown state might hang the kernel completely. Signed-off-by: Thomas Gleixner Cc: stable@vger.kernel.org --- diff --git a/kernel/time/clockevents.c b/kernel/time/clockevents.c index 1ecd6ba36d6c..c4eb71c8b2ea 100644 --- a/kernel/time/clockevents.c +++ b/kernel/time/clockevents.c @@ -387,6 +387,7 @@ void clockevents_exchange_device(struct clock_event_device *old, * released list and do a notify add later. */ if (old) { + old->event_handler = clockevents_handle_noop; clockevents_set_mode(old, CLOCK_EVT_MODE_UNUSED); list_del(&old->list); list_add(&old->list, &clockevents_released);