[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20070626214755.GA11551@electric-eye.fr.zoreil.com>
Date: Tue, 26 Jun 2007 23:47:55 +0200
From: Francois Romieu <romieu@...zoreil.com>
To: Thomas Bogendoerfer <tsbogend@...ha.franken.de>
Cc: netdev@...r.kernel.org, akpm@...ux-foundation.org,
jgarzik@...ox.com
Subject: Re: [PATCH UPDATE] Extract chip specific code out of lasi_82596.c
Thomas Bogendoerfer <tsbogend@...ha.franken.de> :
[...]
> +static inline void init_rx_bufs(struct net_device *dev)
> +{
> + struct i596_private *lp = netdev_priv(dev);
> + struct i596_dma *dma = lp->dma;
> + int i;
> + struct i596_rfd *rfd;
> + struct i596_rbd *rbd;
> +
> + /* First build the Receive Buffer Descriptor List */
> +
> + for (i = 0, rbd = dma->rbds; i < rx_ring_size; i++, rbd++) {
> + dma_addr_t dma_addr;
> + struct sk_buff *skb = dev_alloc_skb(PKT_BUF_SZ + 4);
> +
> + if (skb == NULL)
> + panic(KERN_ERR "%s: alloc_skb() failed", __FILE__);
The driver could use netdev_alloc_skb.
init_rx_bufs() should handle failure more gracefully and return a proper
status code.
[...]
> +static int init_i596_mem(struct net_device *dev)
> +{
[...]
> + if (request_irq(dev->irq, &i596_interrupt, 0, "i82596", dev)) {
> + printk(KERN_ERR "%s: IRQ %d not free\n", dev->name, dev->irq);
> + goto failed_free_irq;
> + }
[...]
> +failed_free_irq:
> + free_irq(dev->irq, dev);
Oops.
--
Ueimor
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists