summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDupuis, Chad <chad.dupuis@cavium.com>2017-02-24 09:31:56 +0100
committerMartin K. Petersen <martin.petersen@oracle.com>2017-02-28 04:21:26 +0100
commit42a70abddd90374518057e989f5b7289b7b535d8 (patch)
tree24f5b3df7f7e1dc50630afa063adb7f2e266e4b6 /drivers
parentscsi: aacraid: remove redundant zero check on ret (diff)
downloadlinux-42a70abddd90374518057e989f5b7289b7b535d8.tar.xz
linux-42a70abddd90374518057e989f5b7289b7b535d8.zip
scsi: qedi: Fix memory leak in tmf response processing.
Signed-off-by: Manish Rangankar <manish.rangankar@cavium.com> Signed-off-by: Chad Dupuis <chad.dupuis@cavium.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/scsi/qedi/qedi_fw.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/scsi/qedi/qedi_fw.c b/drivers/scsi/qedi/qedi_fw.c
index b1d3904ae8fd..c9f0ef4e11b3 100644
--- a/drivers/scsi/qedi/qedi_fw.c
+++ b/drivers/scsi/qedi/qedi_fw.c
@@ -165,10 +165,9 @@ static void qedi_tmf_resp_work(struct work_struct *work)
iscsi_block_session(session->cls_session);
rval = qedi_cleanup_all_io(qedi, qedi_conn, qedi_cmd->task, true);
if (rval) {
- clear_bit(QEDI_CONN_FW_CLEANUP, &qedi_conn->flags);
qedi_clear_task_idx(qedi, qedi_cmd->task_id);
iscsi_unblock_session(session->cls_session);
- return;
+ goto exit_tmf_resp;
}
iscsi_unblock_session(session->cls_session);
@@ -177,6 +176,8 @@ static void qedi_tmf_resp_work(struct work_struct *work)
spin_lock(&session->back_lock);
__iscsi_complete_pdu(conn, (struct iscsi_hdr *)resp_hdr_ptr, NULL, 0);
spin_unlock(&session->back_lock);
+
+exit_tmf_resp:
kfree(resp_hdr_ptr);
clear_bit(QEDI_CONN_FW_CLEANUP, &qedi_conn->flags);
}