diff options
| author | Sreekanth Reddy <sreekanth.reddy@avagotech.com> | 2014-09-12 06:05:33 -0400 |
|---|---|---|
| committer | Christoph Hellwig <hch@lst.de> | 2014-09-16 12:14:21 -0400 |
| commit | b65f1d4da7df44835bd0a2452332e253a5c66d9b (patch) | |
| tree | 717540635f65dfb07055b5df1e7e2df087252db0 /drivers/scsi/mpt2sas | |
| parent | 70d8c86ebeaca552801500d20d5f2c6cc235cabd (diff) | |
mpt3sas, mpt2sas: fix scsi_add_host error handling problems in _scsih_probe
In _scsih_probe, propagate the return value from scsi_add_host.
In mpt3sas, avoid calling list_del twice if that returns an
error, which causes list_del corruption warnings if an error
is returned.
Tested with blk-mq and scsi-mq patches to properly cleanup
from and propagate blk_mq_init_rq_map errors.
Signed-off-by: Robert Elliott <elliott@hp.com>
Acked-by: Sreekanth Reddy <Sreekanth.Reddy@avagotech.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'drivers/scsi/mpt2sas')
| -rw-r--r-- | drivers/scsi/mpt2sas/mpt2sas_scsih.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/scsi/mpt2sas/mpt2sas_scsih.c b/drivers/scsi/mpt2sas/mpt2sas_scsih.c index 231ec34d8ea9..992a224e51ee 100644 --- a/drivers/scsi/mpt2sas/mpt2sas_scsih.c +++ b/drivers/scsi/mpt2sas/mpt2sas_scsih.c | |||
| @@ -8147,6 +8147,7 @@ _scsih_probe(struct pci_dev *pdev, const struct pci_device_id *id) | |||
| 8147 | { | 8147 | { |
| 8148 | struct MPT2SAS_ADAPTER *ioc; | 8148 | struct MPT2SAS_ADAPTER *ioc; |
| 8149 | struct Scsi_Host *shost; | 8149 | struct Scsi_Host *shost; |
| 8150 | int rv; | ||
| 8150 | 8151 | ||
| 8151 | shost = scsi_host_alloc(&scsih_driver_template, | 8152 | shost = scsi_host_alloc(&scsih_driver_template, |
| 8152 | sizeof(struct MPT2SAS_ADAPTER)); | 8153 | sizeof(struct MPT2SAS_ADAPTER)); |
| @@ -8242,6 +8243,7 @@ _scsih_probe(struct pci_dev *pdev, const struct pci_device_id *id) | |||
| 8242 | if (!ioc->firmware_event_thread) { | 8243 | if (!ioc->firmware_event_thread) { |
| 8243 | printk(MPT2SAS_ERR_FMT "failure at %s:%d/%s()!\n", | 8244 | printk(MPT2SAS_ERR_FMT "failure at %s:%d/%s()!\n", |
| 8244 | ioc->name, __FILE__, __LINE__, __func__); | 8245 | ioc->name, __FILE__, __LINE__, __func__); |
| 8246 | rv = -ENODEV; | ||
| 8245 | goto out_thread_fail; | 8247 | goto out_thread_fail; |
| 8246 | } | 8248 | } |
| 8247 | 8249 | ||
| @@ -8249,6 +8251,7 @@ _scsih_probe(struct pci_dev *pdev, const struct pci_device_id *id) | |||
| 8249 | if ((mpt2sas_base_attach(ioc))) { | 8251 | if ((mpt2sas_base_attach(ioc))) { |
| 8250 | printk(MPT2SAS_ERR_FMT "failure at %s:%d/%s()!\n", | 8252 | printk(MPT2SAS_ERR_FMT "failure at %s:%d/%s()!\n", |
| 8251 | ioc->name, __FILE__, __LINE__, __func__); | 8253 | ioc->name, __FILE__, __LINE__, __func__); |
| 8254 | rv = -ENODEV; | ||
| 8252 | goto out_attach_fail; | 8255 | goto out_attach_fail; |
| 8253 | } | 8256 | } |
| 8254 | 8257 | ||
| @@ -8266,7 +8269,8 @@ _scsih_probe(struct pci_dev *pdev, const struct pci_device_id *id) | |||
| 8266 | } else | 8269 | } else |
| 8267 | ioc->hide_drives = 0; | 8270 | ioc->hide_drives = 0; |
| 8268 | 8271 | ||
| 8269 | if ((scsi_add_host(shost, &pdev->dev))) { | 8272 | rv = scsi_add_host(shost, &pdev->dev); |
| 8273 | if (rv) { | ||
| 8270 | printk(MPT2SAS_ERR_FMT "failure at %s:%d/%s()!\n", | 8274 | printk(MPT2SAS_ERR_FMT "failure at %s:%d/%s()!\n", |
| 8271 | ioc->name, __FILE__, __LINE__, __func__); | 8275 | ioc->name, __FILE__, __LINE__, __func__); |
| 8272 | goto out_add_shost_fail; | 8276 | goto out_add_shost_fail; |
| @@ -8283,7 +8287,7 @@ _scsih_probe(struct pci_dev *pdev, const struct pci_device_id *id) | |||
| 8283 | out_thread_fail: | 8287 | out_thread_fail: |
| 8284 | list_del(&ioc->list); | 8288 | list_del(&ioc->list); |
| 8285 | scsi_host_put(shost); | 8289 | scsi_host_put(shost); |
| 8286 | return -ENODEV; | 8290 | return rv; |
| 8287 | } | 8291 | } |
| 8288 | 8292 | ||
| 8289 | #ifdef CONFIG_PM | 8293 | #ifdef CONFIG_PM |
