EDAC: Balance workqueue setup and teardown
commit096676061987c613bdacddbae838cb63a815db94
authorBorislav Petkov <bp@suse.de>
Tue, 2 Feb 2016 09:59:53 +0000 (2 10:59 +0100)
committerBorislav Petkov <bp@suse.de>
Tue, 2 Feb 2016 10:04:29 +0000 (2 11:04 +0100)
tree9a73f90b19376faf2e9c5a55a038000d6ac25594
parentf5793c970888e48542de4ae152d16308873f29e4
EDAC: Balance workqueue setup and teardown

We use the ->edac_check function pointers to determine whether we need
to setup a polling workqueue. However, the destroy path is not balanced
and we might try to teardown an unitialized workqueue.

Balance init and destroy paths by looking at ->edac_check in both cases.
Set op_state to OP_OFFLINE *before* destroying anything.

Reported-by: Zhiqiang Hou <Zhiqiang.Hou@freescale.com>
Cc: Varun Sethi <Varun.Sethi@freescale.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
drivers/edac/edac_mc.c
drivers/edac/edac_pci.c