Commit 8b9b22ba authored by Wei Yongjun's avatar Wei Yongjun Committed by Martin K. Petersen

scsi: qedi: Fix possible memory leak in qedi_iscsi_update_conn()

'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: ace7f46b ("scsi: qedi: Add QLogic FastLinQ offload iSCSI driver framework.")
Signed-off-by: default avatarWei Yongjun <weiyongjun1@huawei.com>
Acked-by: default avatarManish Rangankar <Manish.Rangankar@cavium.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 7942f7b5
...@@ -454,13 +454,9 @@ static int qedi_iscsi_update_conn(struct qedi_ctx *qedi, ...@@ -454,13 +454,9 @@ static int qedi_iscsi_update_conn(struct qedi_ctx *qedi,
if (rval) { if (rval) {
rval = -ENXIO; rval = -ENXIO;
QEDI_ERR(&qedi->dbg_ctx, "Could not update connection\n"); QEDI_ERR(&qedi->dbg_ctx, "Could not update connection\n");
goto update_conn_err;
} }
kfree(conn_info); kfree(conn_info);
rval = 0;
update_conn_err:
return rval; return rval;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment