mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-18 03:01:26 +00:00
scst_local_add_target(): Also set *out_tgt upon failure
Although the callers of scst_local_add_target() do not use the value of *out_tgt if scst_local_add_target() reports that it failed, set *out_tgt in that case to avoid that sparse reports the following (false positive) warning: scst_local/scst_local.c:1807: warning: 'tgt' may be used uninitialized in this function Signed-off-by: Bart Van Assche <bvanassche@acm.org> git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4534 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
@@ -1743,12 +1743,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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user