scsi: qedi: Fix possible memory leak in qedi_iscsi_update_conn()
authorWei Yongjun <weiyongjun1@huawei.com>
Tue, 7 Feb 2017 14:52:58 +0000 (14:52 +0000)
committerMartin K. Petersen <martin.petersen@oracle.com>
Thu, 9 Feb 2017 23:35:00 +0000 (18:35 -0500)
'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>
Acked-by: Manish Rangankar <Manish.Rangankar@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/qedi/qedi_iscsi.c

index 8b25f0a1eb8c81384bba19a810ba0d772f5f8d85..b9f79d36142d5e85182d39d16ba34a7a1a6f6521 100644 (file)
@@ -454,13 +454,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;
 }