EDAC: Fix workqueue-related crashes
authorBorislav Petkov <borislav.petkov@amd.com>
Thu, 2 Dec 2010 16:48:35 +0000 (17:48 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 7 Jan 2011 21:58:17 +0000 (13:58 -0800)
commit7cd5c22944bf7abdec73beab9c30d46d363cdbfd
tree1aebbe23ece3e30a561a0ed820b79e3637b4e6ce
parent9bdffa72704f4c34b0efa0f4d192413a16559342
EDAC: Fix workqueue-related crashes

commit bb31b3122c0dd07d2d958da17a50ad771ce79e2b upstream.

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.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/edac/edac_mc.c