diff options
Diffstat (limited to 'drivers/net/netxen/netxen_nic_init.c')
-rw-r--r-- | drivers/net/netxen/netxen_nic_init.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/net/netxen/netxen_nic_init.c b/drivers/net/netxen/netxen_nic_init.c index 045a7c8f5bdf..c865dda2adf1 100644 --- a/drivers/net/netxen/netxen_nic_init.c +++ b/drivers/net/netxen/netxen_nic_init.c | |||
@@ -218,7 +218,7 @@ int netxen_alloc_sw_resources(struct netxen_adapter *adapter) | |||
218 | if (cmd_buf_arr == NULL) { | 218 | if (cmd_buf_arr == NULL) { |
219 | dev_err(&pdev->dev, "%s: failed to allocate cmd buffer ring\n", | 219 | dev_err(&pdev->dev, "%s: failed to allocate cmd buffer ring\n", |
220 | netdev->name); | 220 | netdev->name); |
221 | return -ENOMEM; | 221 | goto err_out; |
222 | } | 222 | } |
223 | memset(cmd_buf_arr, 0, TX_BUFF_RINGSIZE(tx_ring)); | 223 | memset(cmd_buf_arr, 0, TX_BUFF_RINGSIZE(tx_ring)); |
224 | tx_ring->cmd_buf_arr = cmd_buf_arr; | 224 | tx_ring->cmd_buf_arr = cmd_buf_arr; |
@@ -230,7 +230,7 @@ int netxen_alloc_sw_resources(struct netxen_adapter *adapter) | |||
230 | if (rds_ring == NULL) { | 230 | if (rds_ring == NULL) { |
231 | dev_err(&pdev->dev, "%s: failed to allocate rds ring struct\n", | 231 | dev_err(&pdev->dev, "%s: failed to allocate rds ring struct\n", |
232 | netdev->name); | 232 | netdev->name); |
233 | return -ENOMEM; | 233 | goto err_out; |
234 | } | 234 | } |
235 | recv_ctx->rds_rings = rds_ring; | 235 | recv_ctx->rds_rings = rds_ring; |
236 | 236 | ||
@@ -1805,9 +1805,10 @@ netxen_post_rx_buffers(struct netxen_adapter *adapter, u32 ringid, | |||
1805 | netxen_ctx_msg msg = 0; | 1805 | netxen_ctx_msg msg = 0; |
1806 | struct list_head *head; | 1806 | struct list_head *head; |
1807 | 1807 | ||
1808 | spin_lock(&rds_ring->lock); | ||
1809 | |||
1808 | producer = rds_ring->producer; | 1810 | producer = rds_ring->producer; |
1809 | 1811 | ||
1810 | spin_lock(&rds_ring->lock); | ||
1811 | head = &rds_ring->free_list; | 1812 | head = &rds_ring->free_list; |
1812 | while (!list_empty(head)) { | 1813 | while (!list_empty(head)) { |
1813 | 1814 | ||
@@ -1829,7 +1830,6 @@ netxen_post_rx_buffers(struct netxen_adapter *adapter, u32 ringid, | |||
1829 | 1830 | ||
1830 | producer = get_next_index(producer, rds_ring->num_desc); | 1831 | producer = get_next_index(producer, rds_ring->num_desc); |
1831 | } | 1832 | } |
1832 | spin_unlock(&rds_ring->lock); | ||
1833 | 1833 | ||
1834 | if (count) { | 1834 | if (count) { |
1835 | rds_ring->producer = producer; | 1835 | rds_ring->producer = producer; |
@@ -1853,6 +1853,8 @@ netxen_post_rx_buffers(struct netxen_adapter *adapter, u32 ringid, | |||
1853 | NETXEN_RCV_PRODUCER_OFFSET), msg); | 1853 | NETXEN_RCV_PRODUCER_OFFSET), msg); |
1854 | } | 1854 | } |
1855 | } | 1855 | } |
1856 | |||
1857 | spin_unlock(&rds_ring->lock); | ||
1856 | } | 1858 | } |
1857 | 1859 | ||
1858 | static void | 1860 | static void |
@@ -1864,10 +1866,11 @@ netxen_post_rx_buffers_nodb(struct netxen_adapter *adapter, | |||
1864 | int producer, count = 0; | 1866 | int producer, count = 0; |
1865 | struct list_head *head; | 1867 | struct list_head *head; |
1866 | 1868 | ||
1867 | producer = rds_ring->producer; | ||
1868 | if (!spin_trylock(&rds_ring->lock)) | 1869 | if (!spin_trylock(&rds_ring->lock)) |
1869 | return; | 1870 | return; |
1870 | 1871 | ||
1872 | producer = rds_ring->producer; | ||
1873 | |||
1871 | head = &rds_ring->free_list; | 1874 | head = &rds_ring->free_list; |
1872 | while (!list_empty(head)) { | 1875 | while (!list_empty(head)) { |
1873 | 1876 | ||