diff options
Diffstat (limited to 'drivers/infiniband/ulp/ipoib/ipoib_cm.c')
-rw-r--r-- | drivers/infiniband/ulp/ipoib/ipoib_cm.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_cm.c b/drivers/infiniband/ulp/ipoib/ipoib_cm.c index 4e8d0281f8bc..2490b2d79dbb 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_cm.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_cm.c | |||
@@ -38,6 +38,7 @@ | |||
38 | #include <net/icmp.h> | 38 | #include <net/icmp.h> |
39 | #include <linux/icmpv6.h> | 39 | #include <linux/icmpv6.h> |
40 | #include <linux/delay.h> | 40 | #include <linux/delay.h> |
41 | #include <linux/vmalloc.h> | ||
41 | 42 | ||
42 | #include "ipoib.h" | 43 | #include "ipoib.h" |
43 | 44 | ||
@@ -1031,13 +1032,13 @@ static int ipoib_cm_tx_init(struct ipoib_cm_tx *p, u32 qpn, | |||
1031 | struct ipoib_dev_priv *priv = netdev_priv(p->dev); | 1032 | struct ipoib_dev_priv *priv = netdev_priv(p->dev); |
1032 | int ret; | 1033 | int ret; |
1033 | 1034 | ||
1034 | p->tx_ring = kzalloc(ipoib_sendq_size * sizeof *p->tx_ring, | 1035 | p->tx_ring = vmalloc(ipoib_sendq_size * sizeof *p->tx_ring); |
1035 | GFP_KERNEL); | ||
1036 | if (!p->tx_ring) { | 1036 | if (!p->tx_ring) { |
1037 | ipoib_warn(priv, "failed to allocate tx ring\n"); | 1037 | ipoib_warn(priv, "failed to allocate tx ring\n"); |
1038 | ret = -ENOMEM; | 1038 | ret = -ENOMEM; |
1039 | goto err_tx; | 1039 | goto err_tx; |
1040 | } | 1040 | } |
1041 | memset(p->tx_ring, 0, ipoib_sendq_size * sizeof *p->tx_ring); | ||
1041 | 1042 | ||
1042 | p->qp = ipoib_cm_create_tx_qp(p->dev, p); | 1043 | p->qp = ipoib_cm_create_tx_qp(p->dev, p); |
1043 | if (IS_ERR(p->qp)) { | 1044 | if (IS_ERR(p->qp)) { |
@@ -1078,6 +1079,7 @@ err_id: | |||
1078 | ib_destroy_qp(p->qp); | 1079 | ib_destroy_qp(p->qp); |
1079 | err_qp: | 1080 | err_qp: |
1080 | p->qp = NULL; | 1081 | p->qp = NULL; |
1082 | vfree(p->tx_ring); | ||
1081 | err_tx: | 1083 | err_tx: |
1082 | return ret; | 1084 | return ret; |
1083 | } | 1085 | } |
@@ -1128,7 +1130,7 @@ timeout: | |||
1128 | if (p->qp) | 1130 | if (p->qp) |
1129 | ib_destroy_qp(p->qp); | 1131 | ib_destroy_qp(p->qp); |
1130 | 1132 | ||
1131 | kfree(p->tx_ring); | 1133 | vfree(p->tx_ring); |
1132 | kfree(p); | 1134 | kfree(p); |
1133 | } | 1135 | } |
1134 | 1136 | ||