be2iscsi: set the boot_kset pointer to NULL in case of failure
authorMaurizio Lombardi <mlombard@redhat.com>
Fri, 4 Mar 2016 09:41:49 +0000 (10:41 +0100)
committerMartin K. Petersen <martin.petersen@oracle.com>
Mon, 14 Mar 2016 19:50:11 +0000 (15:50 -0400)
In beiscsi_setup_boot_info(), the boot_kset pointer should be set to
NULL in case of failure otherwise an invalid pointer dereference may
occur later.

Cc: <stable@vger.kernel.org>
Signed-off-by: Maurizio Lombardi <mlombard@redhat.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Jitendra Bhivare <jitendra.bhivare@broadcom.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/be2iscsi/be_main.c

index e89a0f8d2c6e9a9b650cc1ca3d30609a475991db..f05e7737107d2a0fced40581b7f34bad70ca2820 100644 (file)
@@ -4493,6 +4493,7 @@ put_shost:
        scsi_host_put(phba->shost);
 free_kset:
        iscsi_boot_destroy_kset(phba->boot_kset);
+       phba->boot_kset = NULL;
        return -ENOMEM;
 }