From: Borislav Petkov Date: Sun, 26 Sep 2010 10:42:23 +0000 (+0200) Subject: amd64_edac: Fix driver module removal X-Git-Tag: v3.0~3251^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=00740c58541b6087d78418cebca1fcb86dc6077d;p=platform%2Fkernel%2Flinux-amlogic.git amd64_edac: Fix driver module removal f4347553b30ec66530bfe63c84530afea3803396 removed the edac polling mechanism in favor of using a notifier chain for conveying MCE information to edac. However, the module removal path didn't test whether the driver had setup the polling function workqueue at all and the rmmod process was hanging in the kernel at try_to_del_timer_sync() in the cancel_delayed_work() path, trying to cancel an uninitialized work struct. Fix that by adding a balancing check to the workqueue removal path. Signed-off-by: Borislav Petkov --- diff --git a/drivers/edac/edac_mc.c b/drivers/edac/edac_mc.c index 3630308..6b21e25 100644 --- a/drivers/edac/edac_mc.c +++ b/drivers/edac/edac_mc.c @@ -339,6 +339,9 @@ static void edac_mc_workq_teardown(struct mem_ctl_info *mci) { int status; + if (mci->op_state != OP_RUNNING_POLL) + return; + status = cancel_delayed_work(&mci->work); if (status == 0) { debugf0("%s() not canceled, flush the queue\n",