diff options
Diffstat (limited to 'drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c')
| -rw-r--r-- | drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c | 28 | 
1 files changed, 10 insertions, 18 deletions
diff --git a/drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c b/drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c index 695667d471a..4782dcfde73 100644 --- a/drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c +++ b/drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c @@ -197,41 +197,33 @@ int netxen_alloc_sw_resources(struct netxen_adapter *adapter)  	struct nx_host_sds_ring *sds_ring;  	struct nx_host_tx_ring *tx_ring;  	struct netxen_rx_buffer *rx_buf; -	int ring, i, size; +	int ring, i;  	struct netxen_cmd_buffer *cmd_buf_arr;  	struct net_device *netdev = adapter->netdev; -	struct pci_dev *pdev = adapter->pdev; -	size = sizeof(struct nx_host_tx_ring); -	tx_ring = kzalloc(size, GFP_KERNEL); -	if (tx_ring == NULL) { -		dev_err(&pdev->dev, "%s: failed to allocate tx ring struct\n", -		       netdev->name); +	tx_ring = kzalloc(sizeof(struct nx_host_tx_ring), GFP_KERNEL); +	if (tx_ring == NULL)  		return -ENOMEM; -	} +  	adapter->tx_ring = tx_ring;  	tx_ring->num_desc = adapter->num_txd;  	tx_ring->txq = netdev_get_tx_queue(netdev, 0);  	cmd_buf_arr = vzalloc(TX_BUFF_RINGSIZE(tx_ring)); -	if (cmd_buf_arr == NULL) { -		dev_err(&pdev->dev, "%s: failed to allocate cmd buffer ring\n", -		       netdev->name); +	if (cmd_buf_arr == NULL)  		goto err_out; -	} +  	tx_ring->cmd_buf_arr = cmd_buf_arr;  	recv_ctx = &adapter->recv_ctx; -	size = adapter->max_rds_rings * sizeof (struct nx_host_rds_ring); -	rds_ring = kzalloc(size, GFP_KERNEL); -	if (rds_ring == NULL) { -		dev_err(&pdev->dev, "%s: failed to allocate rds ring struct\n", -		       netdev->name); +	rds_ring = kcalloc(adapter->max_rds_rings, +			   sizeof(struct nx_host_rds_ring), GFP_KERNEL); +	if (rds_ring == NULL)  		goto err_out; -	} +  	recv_ctx->rds_rings = rds_ring;  	for (ring = 0; ring < adapter->max_rds_rings; ring++) {  |