Skip to contentSkip to conversation

ib_ipath: Fix probe failure path

PATCH Applied Ben Hutchings 2 participants 2 messages Jun 12, 2010 – Jul 21, 2010 InfiniBand

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 ib_ipath: Fix probe failure path

The failure path in ipath_init_one() does not match the cleanup code in ipath_remove_one() and appears to leave interrupts enabled in some cases. Change it to match.

---
In recent Debian kernel packages this driver is patched to use an external firmware image for the SD7220. A user reported in
<http://bugs.debian.org/579393> that if the firmware image is missing the driver crashes about a second later, and I believe this is due to incomplete cleanup on the failure path. He has not yet had an opportunity to test this patch.

Ben.

 drivers/infiniband/hw/ipath/ipath_driver.c |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)
drivers/infiniband/hw/ipath/ipath_driver.c +10 -3
index 2133746..765f0fc 100644
@@ -390,6 +390,8 @@ done:
 	ipath_enable_armlaunch(dd);
 }
 
+static void cleanup_device(struct ipath_devdata *dd);
+
 static int __devinit ipath_init_one(struct pci_dev *pdev,
 				    const struct pci_device_id *ent)
 {
@@ -616,8 +618,13 @@ static int __devinit ipath_init_one(struct pci_dev *pdev,
 	goto bail;
 
 bail_irqsetup:
-	if (pdev->irq)
-		free_irq(pdev->irq, dd);
+	cleanup_device(dd);
+
+	if (dd->ipath_irq)
+		dd->ipath_f_free_irq(dd);
+
+	if (dd->ipath_f_cleanup)
+		dd->ipath_f_cleanup(dd);
 
 bail_iounmap:
 	iounmap((volatile void __iomem *) dd->ipath_kregbase);
@@ -635,7 +642,7 @@ bail:
 	return ret;
 }
 
-static void __devexit cleanup_device(struct ipath_devdata *dd)
+static void cleanup_device(struct ipath_devdata *dd)
 {
 	int port;
 	struct ipath_portdata **tmp;
Signature · 1 line
1.7.1
#1 lore raw

thanks, applied.

Signature · 6 lines
Roland Dreier <[email protected]> || For corporate legal information go to:
http://www.cisco.com/web/about/doing_business/legal/cri/index.html
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html