aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/tg3.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 571320ae87ab..23bad21b5c87 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -4426,7 +4426,7 @@ static void tg3_free_consistent(struct tg3 *tp)
4426 */ 4426 */
4427static int tg3_alloc_consistent(struct tg3 *tp) 4427static int tg3_alloc_consistent(struct tg3 *tp)
4428{ 4428{
4429 tp->rx_std_buffers = kmalloc((sizeof(struct ring_info) * 4429 tp->rx_std_buffers = kzalloc((sizeof(struct ring_info) *
4430 (TG3_RX_RING_SIZE + 4430 (TG3_RX_RING_SIZE +
4431 TG3_RX_JUMBO_RING_SIZE)) + 4431 TG3_RX_JUMBO_RING_SIZE)) +
4432 (sizeof(struct tx_ring_info) * 4432 (sizeof(struct tx_ring_info) *
@@ -4435,13 +4435,6 @@ static int tg3_alloc_consistent(struct tg3 *tp)
4435 if (!tp->rx_std_buffers) 4435 if (!tp->rx_std_buffers)
4436 return -ENOMEM; 4436 return -ENOMEM;
4437 4437
4438 memset(tp->rx_std_buffers, 0,
4439 (sizeof(struct ring_info) *
4440 (TG3_RX_RING_SIZE +
4441 TG3_RX_JUMBO_RING_SIZE)) +
4442 (sizeof(struct tx_ring_info) *
4443 TG3_TX_RING_SIZE));
4444
4445 tp->rx_jumbo_buffers = &tp->rx_std_buffers[TG3_RX_RING_SIZE]; 4438 tp->rx_jumbo_buffers = &tp->rx_std_buffers[TG3_RX_RING_SIZE];
4446 tp->tx_buffers = (struct tx_ring_info *) 4439 tp->tx_buffers = (struct tx_ring_info *)
4447 &tp->rx_jumbo_buffers[TG3_RX_JUMBO_RING_SIZE]; 4440 &tp->rx_jumbo_buffers[TG3_RX_JUMBO_RING_SIZE];