diff options
-rw-r--r-- | drivers/edac/edac_device.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/edac/edac_device.c b/drivers/edac/edac_device.c index 5fcd3d89c75d..4041e9143283 100644 --- a/drivers/edac/edac_device.c +++ b/drivers/edac/edac_device.c | |||
@@ -394,6 +394,12 @@ static void edac_device_workq_function(struct work_struct *work_req) | |||
394 | 394 | ||
395 | mutex_lock(&device_ctls_mutex); | 395 | mutex_lock(&device_ctls_mutex); |
396 | 396 | ||
397 | /* If we are being removed, bail out immediately */ | ||
398 | if (edac_dev->op_state == OP_OFFLINE) { | ||
399 | mutex_unlock(&device_ctls_mutex); | ||
400 | return; | ||
401 | } | ||
402 | |||
397 | /* Only poll controllers that are running polled and have a check */ | 403 | /* Only poll controllers that are running polled and have a check */ |
398 | if ((edac_dev->op_state == OP_RUNNING_POLL) && | 404 | if ((edac_dev->op_state == OP_RUNNING_POLL) && |
399 | (edac_dev->edac_check != NULL)) { | 405 | (edac_dev->edac_check != NULL)) { |
@@ -585,14 +591,14 @@ struct edac_device_ctl_info *edac_device_del_device(struct device *dev) | |||
585 | /* mark this instance as OFFLINE */ | 591 | /* mark this instance as OFFLINE */ |
586 | edac_dev->op_state = OP_OFFLINE; | 592 | edac_dev->op_state = OP_OFFLINE; |
587 | 593 | ||
588 | /* clear workq processing on this instance */ | ||
589 | edac_device_workq_teardown(edac_dev); | ||
590 | |||
591 | /* deregister from global list */ | 594 | /* deregister from global list */ |
592 | del_edac_device_from_global_list(edac_dev); | 595 | del_edac_device_from_global_list(edac_dev); |
593 | 596 | ||
594 | mutex_unlock(&device_ctls_mutex); | 597 | mutex_unlock(&device_ctls_mutex); |
595 | 598 | ||
599 | /* clear workq processing on this instance */ | ||
600 | edac_device_workq_teardown(edac_dev); | ||
601 | |||
596 | /* Tear down the sysfs entries for this instance */ | 602 | /* Tear down the sysfs entries for this instance */ |
597 | edac_device_remove_sysfs(edac_dev); | 603 | edac_device_remove_sysfs(edac_dev); |
598 | 604 | ||