]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
iscsi_boot_sysfs: have this module check for null on destruction
authorMike Christie <michaelc@cs.wisc.edu>
Fri, 24 Jun 2011 20:11:52 +0000 (15:11 -0500)
committerGuru Anbalagane <guru.anbalagane@oracle.com>
Fri, 16 Dec 2011 02:30:23 +0000 (18:30 -0800)
This moves the check for NULL boot_sets to the iscsi_boot_sysfs
module instead of having the drivers do it.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
drivers/scsi/be2iscsi/be_main.c
drivers/scsi/iscsi_boot_sysfs.c

index 94b9a07845d567a950857afdae79296da1f6fb1f..ef49c7e9cd073630dfcba8900c7c794dc7bacd2f 100644 (file)
@@ -420,8 +420,7 @@ static int beiscsi_setup_boot_info(struct beiscsi_hba *phba)
        return 0;
 
 free_kset:
-       if (phba->boot_kset)
-               iscsi_boot_destroy_kset(phba->boot_kset);
+       iscsi_boot_destroy_kset(phba->boot_kset);
        return -ENOMEM;
 }
 
@@ -4150,8 +4149,7 @@ static void beiscsi_remove(struct pci_dev *pcidev)
                            phba->ctrl.mbox_mem_alloced.size,
                            phba->ctrl.mbox_mem_alloced.va,
                            phba->ctrl.mbox_mem_alloced.dma);
-       if (phba->boot_kset)
-               iscsi_boot_destroy_kset(phba->boot_kset);
+       iscsi_boot_destroy_kset(phba->boot_kset);
        iscsi_host_remove(phba->shost);
        pci_dev_put(phba->pcidev);
        iscsi_host_free(phba->shost);
index df6bff7366cf01affb3b6510a5e174273f6fb7b5..4274ce93d8f2c6969f32fd857821ff82c4f331a5 100644 (file)
@@ -472,6 +472,9 @@ void iscsi_boot_destroy_kset(struct iscsi_boot_kset *boot_kset)
 {
        struct iscsi_boot_kobj *boot_kobj, *tmp_kobj;
 
+       if (!boot_kset)
+               return;
+
        list_for_each_entry_safe(boot_kobj, tmp_kobj,
                                 &boot_kset->kobj_list, list)
                iscsi_boot_remove_kobj(boot_kobj);