public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] scsi: qedi: Fix possible memory leak in qedi_iscsi_update_conn()
@ 2017-02-07 14:52 Wei Yongjun
  2017-02-08  5:51 ` Rangankar, Manish
  2017-02-09 23:35 ` Martin K. Petersen
  0 siblings, 2 replies; 3+ messages in thread
From: Wei Yongjun @ 2017-02-07 14:52 UTC (permalink / raw)
  To: James E . J . Bottomley, Martin K. Petersen, Manish Rangankar
  Cc: Wei Yongjun, QLogic-Storage-Upstream, linux-scsi

From: Wei Yongjun <weiyongjun1@huawei.com>

'conn_info' is malloced in qedi_iscsi_update_conn() and should be
freed before leaving from the error handling cases, otherwise it
will cause memory leak.

Fixes: ace7f46ba5fd ("scsi: qedi: Add QLogic FastLinQ offload iSCSI
driver framework.")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
 drivers/scsi/qedi/qedi_iscsi.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/scsi/qedi/qedi_iscsi.c b/drivers/scsi/qedi/qedi_iscsi.c
index d6a2054..eb64469 100644
--- a/drivers/scsi/qedi/qedi_iscsi.c
+++ b/drivers/scsi/qedi/qedi_iscsi.c
@@ -453,13 +453,9 @@ static int qedi_iscsi_update_conn(struct qedi_ctx *qedi,
 	if (rval) {
 		rval = -ENXIO;
 		QEDI_ERR(&qedi->dbg_ctx, "Could not update connection\n");
-		goto update_conn_err;
 	}
 
 	kfree(conn_info);
-	rval = 0;
-
-update_conn_err:
 	return rval;
 }

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-02-09 23:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-02-07 14:52 [PATCH -next] scsi: qedi: Fix possible memory leak in qedi_iscsi_update_conn() Wei Yongjun
2017-02-08  5:51 ` Rangankar, Manish
2017-02-09 23:35 ` Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox