aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/edac
diff options
context:
space:
mode:
authorBorislav Petkov <borislav.petkov@amd.com>2010-12-02 11:48:35 -0500
committerBorislav Petkov <borislav.petkov@amd.com>2010-12-08 13:52:27 -0500
commitbb31b3122c0dd07d2d958da17a50ad771ce79e2b (patch)
treec76193ec64772ee387be80245e86d093ab16c908 /drivers/edac
parentcf7d7e5a1980d1116ee152d25dac382b112b9c17 (diff)
EDAC: Fix workqueue-related crashes
00740c58541b6087d78418cebca1fcb86dc6077d changed edac_core to un-/register a workqueue item only if a lowlevel driver supplies a polling routine. Normally, when we remove a polling low-level driver, we go and cancel all the queued work. However, the workqueue unreg happens based on the ->op_state setting, and edac_mc_del_mc() sets this to OP_OFFLINE _before_ we cancel the work item, leading to NULL ptr oops on the workqueue list. Fix it by putting the unreg stuff in proper order. Cc: <stable@kernel.org> #36.x Reported-and-tested-by: Tobias Karnat <tobias.karnat@googlemail.com> LKML-Reference: <1291201307.3029.21.camel@Tobias-Karnat> Signed-off-by: Borislav Petkov <borislav.petkov@amd.com>
Diffstat (limited to 'drivers/edac')
-rw-r--r--drivers/edac/edac_mc.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/edac/edac_mc.c b/drivers/edac/edac_mc.c
index ba6586a69ccc..795ea69c4d8f 100644
--- a/drivers/edac/edac_mc.c
+++ b/drivers/edac/edac_mc.c
@@ -586,14 +586,16 @@ struct mem_ctl_info *edac_mc_del_mc(struct device *dev)
586 return NULL; 586 return NULL;
587 } 587 }
588 588
589 /* marking MCI offline */
590 mci->op_state = OP_OFFLINE;
591
592 del_mc_from_global_list(mci); 589 del_mc_from_global_list(mci);
593 mutex_unlock(&mem_ctls_mutex); 590 mutex_unlock(&mem_ctls_mutex);
594 591
595 /* flush workq processes and remove sysfs */ 592 /* flush workq processes */
596 edac_mc_workq_teardown(mci); 593 edac_mc_workq_teardown(mci);
594
595 /* marking MCI offline */
596 mci->op_state = OP_OFFLINE;
597
598 /* remove from sysfs */
597 edac_remove_sysfs_mci_device(mci); 599 edac_remove_sysfs_mci_device(mci);
598 600
599 edac_printk(KERN_INFO, EDAC_MC, 601 edac_printk(KERN_INFO, EDAC_MC,