diff options
Diffstat (limited to 'drivers/infiniband/ulp/ipoib/ipoib_main.c')
-rw-r--r-- | drivers/infiniband/ulp/ipoib/ipoib_main.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c index 273d5f418a67..8b67db868306 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_main.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c | |||
@@ -729,25 +729,21 @@ int ipoib_dev_init(struct net_device *dev, struct ib_device *ca, int port) | |||
729 | 729 | ||
730 | /* Allocate RX/TX "rings" to hold queued skbs */ | 730 | /* Allocate RX/TX "rings" to hold queued skbs */ |
731 | 731 | ||
732 | priv->rx_ring = kmalloc(IPOIB_RX_RING_SIZE * sizeof (struct ipoib_rx_buf), | 732 | priv->rx_ring = kzalloc(IPOIB_RX_RING_SIZE * sizeof (struct ipoib_rx_buf), |
733 | GFP_KERNEL); | 733 | GFP_KERNEL); |
734 | if (!priv->rx_ring) { | 734 | if (!priv->rx_ring) { |
735 | printk(KERN_WARNING "%s: failed to allocate RX ring (%d entries)\n", | 735 | printk(KERN_WARNING "%s: failed to allocate RX ring (%d entries)\n", |
736 | ca->name, IPOIB_RX_RING_SIZE); | 736 | ca->name, IPOIB_RX_RING_SIZE); |
737 | goto out; | 737 | goto out; |
738 | } | 738 | } |
739 | memset(priv->rx_ring, 0, | ||
740 | IPOIB_RX_RING_SIZE * sizeof (struct ipoib_rx_buf)); | ||
741 | 739 | ||
742 | priv->tx_ring = kmalloc(IPOIB_TX_RING_SIZE * sizeof (struct ipoib_tx_buf), | 740 | priv->tx_ring = kzalloc(IPOIB_TX_RING_SIZE * sizeof (struct ipoib_tx_buf), |
743 | GFP_KERNEL); | 741 | GFP_KERNEL); |
744 | if (!priv->tx_ring) { | 742 | if (!priv->tx_ring) { |
745 | printk(KERN_WARNING "%s: failed to allocate TX ring (%d entries)\n", | 743 | printk(KERN_WARNING "%s: failed to allocate TX ring (%d entries)\n", |
746 | ca->name, IPOIB_TX_RING_SIZE); | 744 | ca->name, IPOIB_TX_RING_SIZE); |
747 | goto out_rx_ring_cleanup; | 745 | goto out_rx_ring_cleanup; |
748 | } | 746 | } |
749 | memset(priv->tx_ring, 0, | ||
750 | IPOIB_TX_RING_SIZE * sizeof (struct ipoib_tx_buf)); | ||
751 | 747 | ||
752 | /* priv->tx_head & tx_tail are already 0 */ | 748 | /* priv->tx_head & tx_tail are already 0 */ |
753 | 749 | ||