}  for (i = 0; i < SONIC_NUM_RRS; i++) { struct sk_buff *skb = dev_alloc_skb(SONIC_RBSIZE + 2); if (skb == NULL) { while(i > 0) { /* free any that were allocated successfully */ i--; dev_kfree_skb(lp->rx_skb[i]); lp->rx_skb[i] = NULL; } printk(KERN_ERR "%s: couldn't allocate receive buffers\n", dev->name); return -ENOMEM; } skb->dev = dev; /* align IP header unless DMA requires otherwise */ if (SONIC_BUS_SCALE(lp->dma_bitmode) == 2) skb_reserve(skb, 2); lp->rx_skb[i] = skb; }  for (i = 0; i < SONIC_NUM_RRS; i++) { dma_addr_t laddr = dma_map_single(lp->device, skb_put(lp->rx_skb[i], SONIC_RBSIZE), SONIC_RBSIZE, DMA_FROM_DEVICE); if (!laddr) { while(i > 0) { /* free any that were mapped successfully */ i--; dma_unmap_single(lp->device, lp->rx_laddr[i], SONIC_RBSIZE, DMA_FROM_DEVICE); lp->rx_laddr[i] = (dma_addr_t)0; } for (i = 0; i < SONIC_NUM_RRS; i++) { dev_kfree_skb(lp->rx_skb[i]); lp->rx_skb[i] = NULL; } printk(KERN_ERR "%s: couldn't map rx DMA buffers\n", dev->name); return -ENOMEM; } lp->rx_laddr[i] = laddr; 
static int sonic_open(struct net_device *dev){	if (sonic_debug > 2)		printk("sonic_open: initializing sonic driver.\n");	/*	 * We don't need to deal with auto-irq stuff since we	 * hardwire the sonic interrupt.	 *//* * XXX Horrible work around:  We install sonic_interrupt as fast interrupt. * This means that during execution of the handler interrupt are disabled * covering another bug otherwise corrupting data.  This doesn't mean * this glue works ok under all situations. *///    if (sonic_request_irq(dev->irq, &sonic_interrupt, 0, "sonic", dev)) {	if (sonic_request_irq(dev->irq, &sonic_interrupt, SA_INTERRUPT,	                      "sonic", dev)) {		printk("\n%s: unable to get IRQ %d .\n", dev->name, dev->irq);		return -EAGAIN;	}	/*	 * Initialize the SONIC	 */	sonic_init(dev);	netif_start_queue(dev);	if (sonic_debug > 2)		printk("sonic_open: Initialization done.\n");	return 0;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/efcce839360fb3a7b6dedeacaec80f68b0f2d052/sonic.c/clean/drivers/net/sonic.c