scst_local: scst_local_add_target(): Also set *out_tgt upon failure (merge r4534 from trunk)

git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/2.2.x@4707 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Bart Van Assche
2013-01-06 14:14:19 +00:00
parent 9273026e5f
commit 4137032bf4

View File

@@ -1756,12 +1756,12 @@ static int scst_local_add_target(const char *target_name,
list_add_tail(&tgt->tgts_list_entry, &scst_local_tgts_list);
mutex_unlock(&scst_local_mutex);
if (out_tgt != NULL)
*out_tgt = tgt;
res = 0;
out:
if (out_tgt != NULL)
*out_tgt = tgt;
TRACE_EXIT_RES(res);
return res;