From: Alexey Dobriyan Date: Thu, 6 Oct 2005 22:05:23 +0000 (+0400) Subject: [PATCH] starfire: free_irq() on error path of netdev_open() X-Git-Tag: v2.6.15-rc1~731^2~3^2~21 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d8840ac907c7943bc7e196b11812adfa95cb28ef;p=linux-2.6 [PATCH] starfire: free_irq() on error path of netdev_open() Signed-off-by: Alexey Dobriyan Signed-off-by: Jeff Garzik --- diff --git a/drivers/net/starfire.c b/drivers/net/starfire.c index efdb179ecc..38b2b0a3ce 100644 --- a/drivers/net/starfire.c +++ b/drivers/net/starfire.c @@ -1091,8 +1091,10 @@ static int netdev_open(struct net_device *dev) rx_ring_size = sizeof(struct starfire_rx_desc) * RX_RING_SIZE; np->queue_mem_size = tx_done_q_size + rx_done_q_size + tx_ring_size + rx_ring_size; np->queue_mem = pci_alloc_consistent(np->pci_dev, np->queue_mem_size, &np->queue_mem_dma); - if (np->queue_mem == 0) + if (np->queue_mem == NULL) { + free_irq(dev->irq, dev); return -ENOMEM; + } np->tx_done_q = np->queue_mem; np->tx_done_q_dma = np->queue_mem_dma;