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)
committerSasha Levin <sasha.levin@oracle.com>
Mon, 18 Apr 2016 12:49:26 +0000 (08:49 -0400)
[ Upstream commit 84bd64993f916bcf86270c67686ecf4cea7b8933 ]

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>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
drivers/scsi/be2iscsi/be_main.c

index be4586b788d1dad77f49d635c1b4ef3234f084f2..3ed37dc28b3cad2b3057e1d06c474572e512bbe7 100644 (file)
@@ -4435,6 +4435,7 @@ static int beiscsi_setup_boot_info(struct beiscsi_hba *phba)
        scsi_host_put(phba->shost);
 free_kset:
        iscsi_boot_destroy_kset(phba->boot_kset);
+       phba->boot_kset = NULL;
        return -ENOMEM;
 }