scst: Fix an error path in scst_tgt_dev_setup_threads()

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8464 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Bart Van Assche
2019-07-21 01:49:03 +00:00
parent 51599b3c44
commit c9b43e0245

View File

@@ -5229,10 +5229,8 @@ int scst_tgt_dev_setup_threads(struct scst_tgt_dev *tgt_dev)
res = scst_add_threads(tgt_dev->active_cmd_threads, NULL,
tgt_dev,
dev->threads_num + tgtt->threads_num);
if (res != 0) {
/* Let's clear here, because no threads could be run */
tgt_dev->active_cmd_threads->io_context = NULL;
}
if (res != 0)
scst_deinit_threads(&tgt_dev->tgt_dev_cmd_threads);
break;
}
case SCST_THREADS_POOL_SHARED:
@@ -5254,6 +5252,8 @@ int scst_tgt_dev_setup_threads(struct scst_tgt_dev *tgt_dev)
out:
if (res == 0)
tm_dbg_init_tgt_dev(tgt_dev);
else
tgt_dev->active_cmd_threads->io_context = NULL;
TRACE_EXIT_RES(res);
return res;