diff options
| author | Mike Christie <michaelc@cs.wisc.edu> | 2011-06-24 16:11:52 -0400 |
|---|---|---|
| committer | James Bottomley <JBottomley@Parallels.com> | 2011-06-29 17:43:03 -0400 |
| commit | 9d04516310aaef3970c642a54531a52123001178 (patch) | |
| tree | 2e1948a93a6a136ebfc9f1ad08b6ab4d200b05cc | |
| parent | c682d602d0f9751c92e07c196be27d8fac6ec3ed (diff) | |
[SCSI] iscsi_boot_sysfs: have this module check for null on destruction
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>
| -rw-r--r-- | drivers/scsi/be2iscsi/be_main.c | 6 | ||||
| -rw-r--r-- | drivers/scsi/iscsi_boot_sysfs.c | 3 |
2 files changed, 5 insertions, 4 deletions
diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c index 7b967ed48962..2e214390c63b 100644 --- a/drivers/scsi/be2iscsi/be_main.c +++ b/drivers/scsi/be2iscsi/be_main.c | |||
| @@ -420,8 +420,7 @@ static int beiscsi_setup_boot_info(struct beiscsi_hba *phba) | |||
| 420 | return 0; | 420 | return 0; |
| 421 | 421 | ||
| 422 | free_kset: | 422 | free_kset: |
| 423 | if (phba->boot_kset) | 423 | iscsi_boot_destroy_kset(phba->boot_kset); |
| 424 | iscsi_boot_destroy_kset(phba->boot_kset); | ||
| 425 | return -ENOMEM; | 424 | return -ENOMEM; |
| 426 | } | 425 | } |
| 427 | 426 | ||
| @@ -4149,8 +4148,7 @@ static void beiscsi_remove(struct pci_dev *pcidev) | |||
| 4149 | phba->ctrl.mbox_mem_alloced.size, | 4148 | phba->ctrl.mbox_mem_alloced.size, |
| 4150 | phba->ctrl.mbox_mem_alloced.va, | 4149 | phba->ctrl.mbox_mem_alloced.va, |
| 4151 | phba->ctrl.mbox_mem_alloced.dma); | 4150 | phba->ctrl.mbox_mem_alloced.dma); |
| 4152 | if (phba->boot_kset) | 4151 | iscsi_boot_destroy_kset(phba->boot_kset); |
| 4153 | iscsi_boot_destroy_kset(phba->boot_kset); | ||
| 4154 | iscsi_host_remove(phba->shost); | 4152 | iscsi_host_remove(phba->shost); |
| 4155 | pci_dev_put(phba->pcidev); | 4153 | pci_dev_put(phba->pcidev); |
| 4156 | iscsi_host_free(phba->shost); | 4154 | iscsi_host_free(phba->shost); |
diff --git a/drivers/scsi/iscsi_boot_sysfs.c b/drivers/scsi/iscsi_boot_sysfs.c index df6bff7366cf..4274ce93d8f2 100644 --- a/drivers/scsi/iscsi_boot_sysfs.c +++ b/drivers/scsi/iscsi_boot_sysfs.c | |||
| @@ -472,6 +472,9 @@ void iscsi_boot_destroy_kset(struct iscsi_boot_kset *boot_kset) | |||
| 472 | { | 472 | { |
| 473 | struct iscsi_boot_kobj *boot_kobj, *tmp_kobj; | 473 | struct iscsi_boot_kobj *boot_kobj, *tmp_kobj; |
| 474 | 474 | ||
| 475 | if (!boot_kset) | ||
| 476 | return; | ||
| 477 | |||
| 475 | list_for_each_entry_safe(boot_kobj, tmp_kobj, | 478 | list_for_each_entry_safe(boot_kobj, tmp_kobj, |
| 476 | &boot_kset->kobj_list, list) | 479 | &boot_kset->kobj_list, list) |
| 477 | iscsi_boot_remove_kobj(boot_kobj); | 480 | iscsi_boot_remove_kobj(boot_kobj); |
