: Fix list corruption if SCST target registration fails
PATCH 1/1 : Fix list corruption if SCST target registration fails
This patch fixes list corruption if SCST target registration fails.
Signed-off-by Arne Redlich <[email protected]>
Signed-off-by Vladislav Bolkhovitin <[email protected]>
target.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/target.c +2 -2
@@ -116,8 +116,6 @@ static int iscsi_target_create(struct tamutex_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: