rxdr->buffer_info = vmalloc(size); 
rxdr->buffer_info = vmalloc_node(size, pcibus_to_node(pdev->bus)); 
e1000_setup_rx_resources(struct e1000_adapter *adapter,                         struct e1000_rx_ring *rxdr){	struct pci_dev *pdev = adapter->pdev;	int size, desc_len;	size = sizeof(struct e1000_buffer) * rxdr->count;	rxdr->buffer_info = vmalloc(size);	if (!rxdr->buffer_info) {		DPRINTK(PROBE, ERR,		"Unable to allocate memory for the receive descriptor ring\n");		return -ENOMEM;	}	memset(rxdr->buffer_info, 0, size);	size = sizeof(struct e1000_ps_page) * rxdr->count;	rxdr->ps_page = kmalloc(size, GFP_KERNEL);	if(!rxdr->ps_page) {		vfree(rxdr->buffer_info);		DPRINTK(PROBE, ERR,		"Unable to allocate memory for the receive descriptor ring\n");		return -ENOMEM;	}	memset(rxdr->ps_page, 0, size);	size = sizeof(struct e1000_ps_page_dma) * rxdr->count;	rxdr->ps_page_dma = kmalloc(size, GFP_KERNEL);	if(!rxdr->ps_page_dma) {		vfree(rxdr->buffer_info);		kfree(rxdr->ps_page);		DPRINTK(PROBE, ERR,		"Unable to allocate memory for the receive descriptor ring\n");		return -ENOMEM;	}	memset(rxdr->ps_page_dma, 0, size);	if(adapter->hw.mac_type <= e1000_82547_rev_2)		desc_len = sizeof(struct e1000_rx_desc);	else		desc_len = sizeof(union e1000_rx_desc_packet_split);	/* Round up to nearest 4K */	rxdr->size = rxdr->count * desc_len;	E1000_ROUNDUP(rxdr->size, 4096);	rxdr->desc = pci_alloc_consistent(pdev, rxdr->size, &rxdr->dma);	if (!rxdr->desc) {		DPRINTK(PROBE, ERR,		"Unable to allocate memory for the receive descriptor ring\n");setup_rx_desc_die:		vfree(rxdr->buffer_info);		kfree(rxdr->ps_page);		kfree(rxdr->ps_page_dma);		return -ENOMEM;	}	/* Fix for errata 23, can't cross 64kB boundary */	if (!e1000_check_64k_bound(adapter, rxdr->desc, rxdr->size)) {		void *olddesc = rxdr->desc;		dma_addr_t olddma = rxdr->dma;		DPRINTK(RX_ERR, ERR, "rxdr align check failed: %u bytes "				     "at %p\n", rxdr->size, rxdr->desc);		/* Try again, without freeing the previous */		rxdr->desc = pci_alloc_consistent(pdev, rxdr->size, &rxdr->dma);		/* Failed allocation, critical failure */		if (!rxdr->desc) {			pci_free_consistent(pdev, rxdr->size, olddesc, olddma);			DPRINTK(PROBE, ERR,				"Unable to allocate memory "				"for the receive descriptor ring\n");			goto setup_rx_desc_die;		}		if (!e1000_check_64k_bound(adapter, rxdr->desc, rxdr->size)) {			/* give up */			pci_free_consistent(pdev, rxdr->size, rxdr->desc,					    rxdr->dma);			pci_free_consistent(pdev, rxdr->size, olddesc, olddma);			DPRINTK(PROBE, ERR,				"Unable to allocate aligned memory "				"for the receive descriptor ring\n");			goto setup_rx_desc_die;		} else {			/* Free old allocation, new allocation was successful */			pci_free_consistent(pdev, rxdr->size, olddesc, olddma);		}	}	memset(rxdr->desc, 0, rxdr->size);	rxdr->next_to_clean = 0;	rxdr->next_to_use = 0;	return 0;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/a7ec15da65ab64c5f97beedc4ff21cf3e0ae71c0/e1000_main.c/buggy/drivers/net/e1000/e1000_main.c