Skip to content

Commit

Permalink
amd64_edac: Fix driver module removal
Browse files Browse the repository at this point in the history
f434755 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 <borislav.petkov@amd.com>
  • Loading branch information
Borislav Petkov committed Sep 27, 2010
1 parent b30a3f6 commit 00740c5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/edac/edac_mc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 00740c5

Please sign in to comment.