From 59641c1d5f7755b8b8ddcb638d46a154f5106388 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Sun, 25 Aug 2019 22:55:20 +0000 Subject: [PATCH] scst: Fix a memory leak Fix the following Coverity complaint: CID 344744 (#1 of 1): Resource leak (RESOURCE_LEAK)5. leaked_storage: Variable sioc going out of scope leaks the storage it points to. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8567 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/scst_lib.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scst/src/scst_lib.c b/scst/src/scst_lib.c index 62a7197ed..ffc78e827 100644 --- a/scst/src/scst_lib.c +++ b/scst/src/scst_lib.c @@ -8650,7 +8650,8 @@ int scst_scsi_exec_async(struct scst_cmd *cmd, void *data, } rq->next_rq = next_rq; #else - return -EOPNOTSUPP; + res = -EOPNOTSUPP; + goto out_free_sioc; #endif } else { rq = blk_map_kern_sg(q, cmd->sg, cmd->sg_cnt, gfp, reading);