From adaed5fdaa72ceae04b5294442def7a765e3208c Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Wed, 29 Apr 2015 15:54:30 +0200 Subject: [PATCH] scst_local: Fix scst_local_add_target() error path Do not return a pointer to freed memory in *out_tgt. Detected by Coverity. Signed-off-by: Bart Van Assche --- scst_local/scst_local.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scst_local/scst_local.c b/scst_local/scst_local.c index abae3052f..5f3564c63 100644 --- a/scst_local/scst_local.c +++ b/scst_local/scst_local.c @@ -1968,10 +1968,10 @@ static int scst_local_add_target(const char *target_name, res = 0; -out: if (out_tgt != NULL) *out_tgt = tgt; +out: TRACE_EXIT_RES(res); return res;