[8/9] Possible VIA-Rhine free irq issue

From: Chris Wright
Date: Wed Mar 16 2005 - 19:20:23 EST


-stable review patch. If anyone has any objections, please let us know.

----

From: Andres Salomon <dilinger@xxxxxxxxxx>

It seems to me that in the VIA Rhine device driver the requested irq might
not be freed in case the alloc_ring() function fails. alloc_ring()
can fail with a ENOMEM return value because of possible
pci_alloc_consistent() failures.

Updated to CodingStyle.

Signed-off-by: Jeff Garzik <jgarzik@xxxxxxxxx>
Signed-off-by: Chris Wright <chrisw@xxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxx>

--- 1.89/drivers/net/via-rhine.c 2005-01-10 08:52:27 -08:00
+++ edited/drivers/net/via-rhine.c 2005-03-11 15:18:25 -08:00
@@ -1197,8 +1197,10 @@ static int rhine_open(struct net_device
dev->name, rp->pdev->irq);

rc = alloc_ring(dev);
- if (rc)
+ if (rc) {
+ free_irq(rp->pdev->irq, dev);
return rc;
+ }
alloc_rbufs(dev);
alloc_tbufs(dev);
rhine_chip_reset(dev);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/