diff options
-rw-r--r-- | drivers/scsi/ips.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/drivers/scsi/ips.c b/drivers/scsi/ips.c index 5f194a807f94..e54d30c6a342 100644 --- a/drivers/scsi/ips.c +++ b/drivers/scsi/ips.c | |||
@@ -6837,13 +6837,10 @@ ips_register_scsi(int index) | |||
6837 | if (request_irq(ha->pcidev->irq, do_ipsintr, IRQF_SHARED, ips_name, ha)) { | 6837 | if (request_irq(ha->pcidev->irq, do_ipsintr, IRQF_SHARED, ips_name, ha)) { |
6838 | IPS_PRINTK(KERN_WARNING, ha->pcidev, | 6838 | IPS_PRINTK(KERN_WARNING, ha->pcidev, |
6839 | "Unable to install interrupt handler\n"); | 6839 | "Unable to install interrupt handler\n"); |
6840 | scsi_host_put(sh); | 6840 | goto err_out_sh; |
6841 | return -1; | ||
6842 | } | 6841 | } |
6843 | 6842 | ||
6844 | kfree(oldha); | 6843 | kfree(oldha); |
6845 | ips_sh[index] = sh; | ||
6846 | ips_ha[index] = ha; | ||
6847 | 6844 | ||
6848 | /* Store away needed values for later use */ | 6845 | /* Store away needed values for later use */ |
6849 | sh->unique_id = (ha->io_addr) ? ha->io_addr : ha->mem_addr; | 6846 | sh->unique_id = (ha->io_addr) ? ha->io_addr : ha->mem_addr; |
@@ -6859,10 +6856,21 @@ ips_register_scsi(int index) | |||
6859 | sh->max_channel = ha->nbus - 1; | 6856 | sh->max_channel = ha->nbus - 1; |
6860 | sh->can_queue = ha->max_cmds - 1; | 6857 | sh->can_queue = ha->max_cmds - 1; |
6861 | 6858 | ||
6862 | scsi_add_host(sh, NULL); | 6859 | if (scsi_add_host(sh, &ha->pcidev->dev)) |
6860 | goto err_out; | ||
6861 | |||
6862 | ips_sh[index] = sh; | ||
6863 | ips_ha[index] = ha; | ||
6864 | |||
6863 | scsi_scan_host(sh); | 6865 | scsi_scan_host(sh); |
6864 | 6866 | ||
6865 | return 0; | 6867 | return 0; |
6868 | |||
6869 | err_out: | ||
6870 | free_irq(ha->pcidev->irq, ha); | ||
6871 | err_out_sh: | ||
6872 | scsi_host_put(sh); | ||
6873 | return -1; | ||
6866 | } | 6874 | } |
6867 | 6875 | ||
6868 | /*---------------------------------------------------------------------------*/ | 6876 | /*---------------------------------------------------------------------------*/ |