Commit 1f99bd4c authored by Christof Schmitt's avatar Christof Schmitt Committed by James Bottomley

[SCSI] zfcp: Fix oops during shutdown of offline device

With the change that the zfcp_adapter struct is only allocated when
the device is set online, the shutdown handler has to check for a
non-existing zfcp_adapter struct. On the other hand, this check is not
necessary in the offline callback, since an online device has the
zfcp_adapter allocated and we go through the offline callback before
removing the ccw device.
Reviewed-by: default avatarFelix Beck <felix.beck@de.ibm.com>
Signed-off-by: default avatarChristof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
parent c5afd81e
...@@ -192,13 +192,9 @@ static int zfcp_ccw_set_offline(struct ccw_device *ccw_device) ...@@ -192,13 +192,9 @@ static int zfcp_ccw_set_offline(struct ccw_device *ccw_device)
mutex_lock(&zfcp_data.config_mutex); mutex_lock(&zfcp_data.config_mutex);
adapter = dev_get_drvdata(&ccw_device->dev); adapter = dev_get_drvdata(&ccw_device->dev);
if (!adapter)
goto out;
zfcp_erp_adapter_shutdown(adapter, 0, "ccsoff1", NULL); zfcp_erp_adapter_shutdown(adapter, 0, "ccsoff1", NULL);
zfcp_erp_wait(adapter); zfcp_erp_wait(adapter);
mutex_unlock(&zfcp_data.config_mutex); mutex_unlock(&zfcp_data.config_mutex);
out:
return 0; return 0;
} }
...@@ -253,9 +249,13 @@ static void zfcp_ccw_shutdown(struct ccw_device *cdev) ...@@ -253,9 +249,13 @@ static void zfcp_ccw_shutdown(struct ccw_device *cdev)
mutex_lock(&zfcp_data.config_mutex); mutex_lock(&zfcp_data.config_mutex);
adapter = dev_get_drvdata(&cdev->dev); adapter = dev_get_drvdata(&cdev->dev);
if (!adapter)
goto out;
zfcp_erp_adapter_shutdown(adapter, 0, "ccshut1", NULL); zfcp_erp_adapter_shutdown(adapter, 0, "ccshut1", NULL);
zfcp_erp_wait(adapter); zfcp_erp_wait(adapter);
zfcp_erp_thread_kill(adapter); zfcp_erp_thread_kill(adapter);
out:
mutex_unlock(&zfcp_data.config_mutex); mutex_unlock(&zfcp_data.config_mutex);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment