From 7acec1e7556a861416bb6b10f3e3cbb6e82fc01d Mon Sep 17 00:00:00 2001 From: "Moore, Eric Dean" Date: Wed, 16 Nov 2005 18:54:17 -0700 Subject: [SCSI] mptfusion - cleaning up xxx_probe error handling This cleans the returning failure conditions of the mptsas/mptfc/mptspi probe routines. Signed-off-by: Eric Moore Signed-off-by: James Bottomley --- drivers/message/fusion/mptspi.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'drivers/message/fusion/mptspi.c') diff --git a/drivers/message/fusion/mptspi.c b/drivers/message/fusion/mptspi.c index 9431d386c72..91bc467477e 100644 --- a/drivers/message/fusion/mptspi.c +++ b/drivers/message/fusion/mptspi.c @@ -178,13 +178,15 @@ mptspi_probe(struct pci_dev *pdev, const struct pci_device_id *id) printk(MYIOC_s_WARN_FMT "Skipping because it's not operational!\n", ioc->name); - return -ENODEV; + error = -ENODEV; + goto out_mptspi_probe; } if (!ioc->active) { printk(MYIOC_s_WARN_FMT "Skipping because it's disabled!\n", ioc->name); - return -ENODEV; + error = -ENODEV; + goto out_mptspi_probe; } /* Sanity check - ensure at least 1 port is INITIATOR capable @@ -209,7 +211,8 @@ mptspi_probe(struct pci_dev *pdev, const struct pci_device_id *id) printk(MYIOC_s_WARN_FMT "Unable to register controller with SCSI subsystem\n", ioc->name); - return -1; + error = -1; + goto out_mptspi_probe; } spin_lock_irqsave(&ioc->FreeQlock, flags); @@ -287,7 +290,7 @@ mptspi_probe(struct pci_dev *pdev, const struct pci_device_id *id) mem = kmalloc(sz, GFP_ATOMIC); if (mem == NULL) { error = -ENOMEM; - goto mptspi_probe_failed; + goto out_mptspi_probe; } memset(mem, 0, sz); @@ -305,7 +308,7 @@ mptspi_probe(struct pci_dev *pdev, const struct pci_device_id *id) mem = kmalloc(sz, GFP_ATOMIC); if (mem == NULL) { error = -ENOMEM; - goto mptspi_probe_failed; + goto out_mptspi_probe; } memset(mem, 0, sz); @@ -386,13 +389,13 @@ mptspi_probe(struct pci_dev *pdev, const struct pci_device_id *id) if(error) { dprintk((KERN_ERR MYNAM "scsi_add_host failed\n")); - goto mptspi_probe_failed; + goto out_mptspi_probe; } scsi_scan_host(sh); return 0; -mptspi_probe_failed: +out_mptspi_probe: mptscsih_remove(pdev); return error; -- cgit v1.2.3