From 3861a12da54d3ba1f4263c46ee6f6fcebbe2ee22 Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Mon, 27 Aug 2012 22:12:15 +0000 Subject: [PATCH] Fix incorrect errors handling. Detected by smatch. Signed-off-by: Bart Van Assche git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4492 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- iscsi-scst/kernel/iscsi.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/iscsi-scst/kernel/iscsi.c b/iscsi-scst/kernel/iscsi.c index be7029392..190670a50 100644 --- a/iscsi-scst/kernel/iscsi.c +++ b/iscsi-scst/kernel/iscsi.c @@ -3592,14 +3592,14 @@ static int iscsi_scsi_aen(struct scst_aen *aen) } if (!found) { TRACE_MGMT_DBG("Unable to find alive conn for sess %p", sess); - goto out_err; + goto out_err_unlock; } /* Create a fake request */ fake_req = cmnd_alloc(conn, NULL); if (fake_req == NULL) { PRINT_ERROR("%s", "Unable to alloc fake AEN request"); - goto out_err; + goto out_err_unlock; } mutex_unlock(&sess->target->target_mutex); @@ -3641,9 +3641,12 @@ out: out_err_free_req: req_cmnd_release(fake_req); + goto out_set_res; -out_err: +out_err_unlock: mutex_unlock(&sess->target->target_mutex); + +out_set_res: res = SCST_AEN_RES_FAILED; goto out; }