diff mbox

qedi: Fix memory leak in tmf response processing.

Message ID 1487925116-18650-1-git-send-email-manish.rangankar@cavium.com (mailing list archive)
State Accepted, archived
Headers show

Commit Message

Rangankar, Manish Feb. 24, 2017, 8:31 a.m. UTC
From: "Dupuis, Chad" <chad.dupuis@cavium.com>

Signed-off-by: Manish Rangankar <manish.rangankar@cavium.com>
Signed-off-by: Chad Dupuis <chad.dupuis@cavium.com>
---
 drivers/scsi/qedi/qedi_fw.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Martin K. Petersen Feb. 28, 2017, 3:21 a.m. UTC | #1
>>>>> "Manish" == Manish Rangankar <manish.rangankar@cavium.com> writes:

Manish,

Applied to 4.11/scsi-fixes.
diff mbox

Patch

diff --git a/drivers/scsi/qedi/qedi_fw.c b/drivers/scsi/qedi/qedi_fw.c
index b1d3904..c9f0ef4 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);
 }