]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 14 May 2017 12:08:27 +0000 (14:08 +0200)
commit 8b9b22ba75907dcced88c815a5427ec0b4298aec upstream.

'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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/scsi/qedi/qedi_iscsi.c

index d6a205433b66b6d2da39cbdbe99691d89afa2705..eb644696e27db03ab107fd7fc50faffb249f503f 100644 (file)
@@ -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;
 }