All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] target:fix destory device in target_configure_device
@ 2018-01-15 12:09 tang.wenji
  2018-01-15 20:43 ` Mike Christie
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: tang.wenji @ 2018-01-15 12:09 UTC (permalink / raw)
  To: target-devel

From: tangwenji <tang.wenji@zte.com.cn>

After dev->transport->configure_device succeeds,target_configure_device
exits abnormally, dev_flags has not set DF_CONFIGURED yet, does not call
destory_device function in free_device

Signed-off-by: tangwenji <tang.wenji@zte.com.cn>
---
 drivers/target/target_core_device.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/target/target_core_device.c b/drivers/target/target_core_device.c
index e8dd6da..18716fa 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)
 
 	ret = core_setup_alua(dev);
 	if (ret)
-		goto out_free_index;
+		goto out_destory_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_destory_device:
+	dev->transport->destroy_device(dev);
 out_free_index:
 	mutex_lock(&device_mutex);
 	idr_remove(&devices_idr, dev->dev_index);
-- 
2.8.1.windows.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-01-18  9:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-15 12:09 [PATCH] target:fix destory device in target_configure_device tang.wenji
2018-01-15 20:43 ` Mike Christie
2018-01-16 16:04 ` Bart Van Assche
2018-01-18  9:22 ` Nicholas A. Bellinger

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.