From 87fdc2901bd15ab8973c32c8c0b11535318192e8 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Sun, 6 Jan 2013 13:35:09 +0000 Subject: [PATCH] iscsi-scst: Fix incorrect error handling (merge r4492 from trunk) git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/2.2.x@4700 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 cc9bb4c56..5054eb98c 100644 --- a/iscsi-scst/kernel/iscsi.c +++ b/iscsi-scst/kernel/iscsi.c @@ -3615,14 +3615,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); @@ -3664,9 +3664,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; }