]> git.hungrycats.org Git - linux/commitdiff
[PATCH] Possible VIA-Rhine free irq issue
authorAndres Salomon <dilinger@debian.org>
Fri, 18 Mar 2005 13:43:33 +0000 (05:43 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 18 Mar 2005 13:43:33 +0000 (05:43 -0800)
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@pobox.com>
Signed-off-by: Chris Wright <chrisw@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/net/via-rhine.c

index b48c1e315c6f59d88782261ac55a9f6f00040dc3..f553ba701e6b9ecedcd723fc26290124d1db9ac5 100644 (file)
@@ -1197,8 +1197,10 @@ static int rhine_open(struct net_device *dev)
                       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);