]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 12 Apr 2016 16:12:40 +0000 (09:12 -0700)
commit 84bd64993f916bcf86270c67686ecf4cea7b8933 upstream.

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.

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

index 19ddd43a00cfe26cb35d8b5e37f742cd931b8dd2..f4b9ac4ef16ef721501dcce76d3df07f5f10d3e4 100644 (file)
@@ -4432,6 +4432,7 @@ put_shost:
        scsi_host_put(phba->shost);
 free_kset:
        iscsi_boot_destroy_kset(phba->boot_kset);
+       phba->boot_kset = NULL;
        return -ENOMEM;
 }