diff options
author | tangwenji <tang.wenji@zte.com.cn> | 2018-01-15 07:09:37 -0500 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2018-01-18 04:21:11 -0500 |
commit | c82b59e7c3f81059b1d280e21028c7ac8451dd52 (patch) | |
tree | 310323c2fdc4d5b7be2440a4a864968045f73fcd | |
parent | 892782caf19a97ccc95df51b3bb659ecacff986a (diff) |
target: fix destroy device in target_configure_device
After dev->transport->configure_device succeeds, target_configure_device
exits abnormally, dev_flags has not set DF_CONFIGURED yet, does not call
destroy_device function in free_device.
Signed-off-by: tangwenji <tang.wenji@zte.com.cn>
Acked-by: Mike Christie <mchristi@redhat.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
-rw-r--r-- | drivers/target/target_core_device.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/target/target_core_device.c b/drivers/target/target_core_device.c index e8dd6da164b2..e27db4d45a9d 100644 --- a/drivers/target/target_core_device.c +++ b/drivers/target/target_core_device.c | |||
@@ -997,7 +997,7 @@ int target_configure_device(struct se_device *dev) | |||
997 | 997 | ||
998 | ret = core_setup_alua(dev); | 998 | ret = core_setup_alua(dev); |
999 | if (ret) | 999 | if (ret) |
1000 | goto out_free_index; | 1000 | goto out_destroy_device; |
1001 | 1001 | ||
1002 | /* | 1002 | /* |
1003 | * Startup the struct se_device processing thread | 1003 | * Startup the struct se_device processing thread |
@@ -1041,6 +1041,8 @@ int target_configure_device(struct se_device *dev) | |||
1041 | 1041 | ||
1042 | out_free_alua: | 1042 | out_free_alua: |
1043 | core_alua_free_lu_gp_mem(dev); | 1043 | core_alua_free_lu_gp_mem(dev); |
1044 | out_destroy_device: | ||
1045 | dev->transport->destroy_device(dev); | ||
1044 | out_free_index: | 1046 | out_free_index: |
1045 | mutex_lock(&device_mutex); | 1047 | mutex_lock(&device_mutex); |
1046 | idr_remove(&devices_idr, dev->dev_index); | 1048 | idr_remove(&devices_idr, dev->dev_index); |