aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/arcmsr
diff options
context:
space:
mode:
authorChing Huang <ching2048@areca.com.tw>2014-08-19 03:28:36 -0400
committerChristoph Hellwig <hch@lst.de>2014-09-16 12:40:11 -0400
commitb4eb6ae9075a958ffe24620f985f6bd729a1b138 (patch)
tree6bd58c4637390eb83e93200cb20b8c4b156c3bd3 /drivers/scsi/arcmsr
parent5b37479adee7164b17b6e2030b9a30d04583eb61 (diff)
arcmsr: call scsi_scan_host at the end of host initialization
Call scsi_scan_host at the end of host initialization and fix and error path to free allocated resource. Signed-off-by: Ching Huang <ching2048@areca.com.tw> Reviewed-by: Tomas Henzl <thenzl@redhat.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/scsi/arcmsr')
-rw-r--r--drivers/scsi/arcmsr/arcmsr_hba.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/scsi/arcmsr/arcmsr_hba.c b/drivers/scsi/arcmsr/arcmsr_hba.c
index b3cb969c72d5..3d3cdfe07089 100644
--- a/drivers/scsi/arcmsr/arcmsr_hba.c
+++ b/drivers/scsi/arcmsr/arcmsr_hba.c
@@ -112,6 +112,7 @@ static void arcmsr_hbaD_message_isr(struct AdapterControlBlock *acb);
112static void arcmsr_hardware_reset(struct AdapterControlBlock *acb); 112static void arcmsr_hardware_reset(struct AdapterControlBlock *acb);
113static const char *arcmsr_info(struct Scsi_Host *); 113static const char *arcmsr_info(struct Scsi_Host *);
114static irqreturn_t arcmsr_interrupt(struct AdapterControlBlock *acb); 114static irqreturn_t arcmsr_interrupt(struct AdapterControlBlock *acb);
115static void arcmsr_free_irq(struct pci_dev *, struct AdapterControlBlock *);
115static int arcmsr_adjust_disk_queue_depth(struct scsi_device *sdev, 116static int arcmsr_adjust_disk_queue_depth(struct scsi_device *sdev,
116 int queue_depth, int reason) 117 int queue_depth, int reason)
117{ 118{
@@ -755,12 +756,11 @@ static int arcmsr_probe(struct pci_dev *pdev, const struct pci_device_id *id)
755 } 756 }
756 error = scsi_add_host(host, &pdev->dev); 757 error = scsi_add_host(host, &pdev->dev);
757 if(error){ 758 if(error){
758 goto RAID_controller_stop; 759 goto free_ccb_pool;
759 } 760 }
760 if (arcmsr_request_irq(pdev, acb) == FAILED) 761 if (arcmsr_request_irq(pdev, acb) == FAILED)
761 goto scsi_host_remove; 762 goto scsi_host_remove;
762 arcmsr_iop_init(acb); 763 arcmsr_iop_init(acb);
763 scsi_scan_host(host);
764 INIT_WORK(&acb->arcmsr_do_message_isr_bh, arcmsr_message_isr_bh_fn); 764 INIT_WORK(&acb->arcmsr_do_message_isr_bh, arcmsr_message_isr_bh_fn);
765 atomic_set(&acb->rq_map_token, 16); 765 atomic_set(&acb->rq_map_token, 16);
766 atomic_set(&acb->ante_token_value, 16); 766 atomic_set(&acb->ante_token_value, 16);
@@ -772,13 +772,17 @@ static int arcmsr_probe(struct pci_dev *pdev, const struct pci_device_id *id)
772 add_timer(&acb->eternal_timer); 772 add_timer(&acb->eternal_timer);
773 if(arcmsr_alloc_sysfs_attr(acb)) 773 if(arcmsr_alloc_sysfs_attr(acb))
774 goto out_free_sysfs; 774 goto out_free_sysfs;
775 scsi_scan_host(host);
775 return 0; 776 return 0;
776out_free_sysfs: 777out_free_sysfs:
777scsi_host_remove: 778 del_timer_sync(&acb->eternal_timer);
778 scsi_remove_host(host); 779 flush_work(&acb->arcmsr_do_message_isr_bh);
779RAID_controller_stop:
780 arcmsr_stop_adapter_bgrb(acb); 780 arcmsr_stop_adapter_bgrb(acb);
781 arcmsr_flush_adapter_cache(acb); 781 arcmsr_flush_adapter_cache(acb);
782 arcmsr_free_irq(pdev, acb);
783scsi_host_remove:
784 scsi_remove_host(host);
785free_ccb_pool:
782 arcmsr_free_ccb_pool(acb); 786 arcmsr_free_ccb_pool(acb);
783free_hbb_mu: 787free_hbb_mu:
784 arcmsr_free_mu(acb); 788 arcmsr_free_mu(acb);