diff options
Diffstat (limited to 'drivers/infiniband/ulp/ipoib/ipoib_main.c')
-rw-r--r-- | drivers/infiniband/ulp/ipoib/ipoib_main.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c index f96477a8ca5a..57282048865c 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_main.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c | |||
@@ -41,6 +41,7 @@ | |||
41 | #include <linux/init.h> | 41 | #include <linux/init.h> |
42 | #include <linux/slab.h> | 42 | #include <linux/slab.h> |
43 | #include <linux/kernel.h> | 43 | #include <linux/kernel.h> |
44 | #include <linux/vmalloc.h> | ||
44 | 45 | ||
45 | #include <linux/if_arp.h> /* For ARPHRD_xxx */ | 46 | #include <linux/if_arp.h> /* For ARPHRD_xxx */ |
46 | 47 | ||
@@ -887,13 +888,13 @@ int ipoib_dev_init(struct net_device *dev, struct ib_device *ca, int port) | |||
887 | goto out; | 888 | goto out; |
888 | } | 889 | } |
889 | 890 | ||
890 | priv->tx_ring = kzalloc(ipoib_sendq_size * sizeof *priv->tx_ring, | 891 | priv->tx_ring = vmalloc(ipoib_sendq_size * sizeof *priv->tx_ring); |
891 | GFP_KERNEL); | ||
892 | if (!priv->tx_ring) { | 892 | if (!priv->tx_ring) { |
893 | printk(KERN_WARNING "%s: failed to allocate TX ring (%d entries)\n", | 893 | printk(KERN_WARNING "%s: failed to allocate TX ring (%d entries)\n", |
894 | ca->name, ipoib_sendq_size); | 894 | ca->name, ipoib_sendq_size); |
895 | goto out_rx_ring_cleanup; | 895 | goto out_rx_ring_cleanup; |
896 | } | 896 | } |
897 | memset(priv->tx_ring, 0, ipoib_sendq_size * sizeof *priv->tx_ring); | ||
897 | 898 | ||
898 | /* priv->tx_head, tx_tail & tx_outstanding are already 0 */ | 899 | /* priv->tx_head, tx_tail & tx_outstanding are already 0 */ |
899 | 900 | ||
@@ -903,7 +904,7 @@ int ipoib_dev_init(struct net_device *dev, struct ib_device *ca, int port) | |||
903 | return 0; | 904 | return 0; |
904 | 905 | ||
905 | out_tx_ring_cleanup: | 906 | out_tx_ring_cleanup: |
906 | kfree(priv->tx_ring); | 907 | vfree(priv->tx_ring); |
907 | 908 | ||
908 | out_rx_ring_cleanup: | 909 | out_rx_ring_cleanup: |
909 | kfree(priv->rx_ring); | 910 | kfree(priv->rx_ring); |
@@ -928,7 +929,7 @@ void ipoib_dev_cleanup(struct net_device *dev) | |||
928 | ipoib_ib_dev_cleanup(dev); | 929 | ipoib_ib_dev_cleanup(dev); |
929 | 930 | ||
930 | kfree(priv->rx_ring); | 931 | kfree(priv->rx_ring); |
931 | kfree(priv->tx_ring); | 932 | vfree(priv->tx_ring); |
932 | 933 | ||
933 | priv->rx_ring = NULL; | 934 | priv->rx_ring = NULL; |
934 | priv->tx_ring = NULL; | 935 | priv->tx_ring = NULL; |