[PATCH][iSCSI-SCST]: Fix list corruption if SCST target registration fails

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This patch fixes list corruption if SCST target registration fails.

Signed-off-by: Arne Redlich <agr@xxxxxxxxxxxxxx>
Signed-off-by: Vladislav Bolkhovitin <vst@xxxxxxxx>

 target.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Index: iscsi-scst/kernel/target.c
===================================================================
--- iscsi-scst/kernel/target.c	(revision 648)
+++ iscsi-scst/kernel/target.c	(working copy)
@@ -116,8 +116,6 @@ static int iscsi_target_create(struct ta
 	mutex_init(&target->target_mutex);
 	INIT_LIST_HEAD(&target->session_list);
 
-	list_add(&target->target_list_entry, &target_list);
-
 	target->scst_tgt = scst_register(&iscsi_template, target->name);
 	if (!target->scst_tgt) {
 		PRINT_ERROR("%s", "scst_register() failed");
@@ -125,6 +123,8 @@ static int iscsi_target_create(struct ta
 		goto out_free;
 	}
 
+	list_add(&target->target_list_entry, &target_list);
+
 	return 0;
 
 out_free:

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux