forked from luck/tmp_suning_uos_patched
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>
This commit is contained in:
parent
892782caf1
commit
c82b59e7c3
|
@ -997,7 +997,7 @@ int target_configure_device(struct se_device *dev)
|
|||
|
||||
ret = core_setup_alua(dev);
|
||||
if (ret)
|
||||
goto out_free_index;
|
||||
goto out_destroy_device;
|
||||
|
||||
/*
|
||||
* Startup the struct se_device processing thread
|
||||
|
@ -1041,6 +1041,8 @@ int target_configure_device(struct se_device *dev)
|
|||
|
||||
out_free_alua:
|
||||
core_alua_free_lu_gp_mem(dev);
|
||||
out_destroy_device:
|
||||
dev->transport->destroy_device(dev);
|
||||
out_free_index:
|
||||
mutex_lock(&device_mutex);
|
||||
idr_remove(&devices_idr, dev->dev_index);
|
||||
|
|
Loading…
Reference in New Issue
Block a user