diff options
Diffstat (limited to 'drivers/infiniband/ulp/ipoib/ipoib_ib.c')
-rw-r--r-- | drivers/infiniband/ulp/ipoib/ipoib_ib.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_ib.c b/drivers/infiniband/ulp/ipoib/ipoib_ib.c index 0ef9af94997d..4115be54ba3b 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_ib.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_ib.c | |||
@@ -57,21 +57,24 @@ struct ipoib_ah *ipoib_create_ah(struct net_device *dev, | |||
57 | struct ib_pd *pd, struct ib_ah_attr *attr) | 57 | struct ib_pd *pd, struct ib_ah_attr *attr) |
58 | { | 58 | { |
59 | struct ipoib_ah *ah; | 59 | struct ipoib_ah *ah; |
60 | struct ib_ah *vah; | ||
60 | 61 | ||
61 | ah = kmalloc(sizeof *ah, GFP_KERNEL); | 62 | ah = kmalloc(sizeof *ah, GFP_KERNEL); |
62 | if (!ah) | 63 | if (!ah) |
63 | return NULL; | 64 | return ERR_PTR(-ENOMEM); |
64 | 65 | ||
65 | ah->dev = dev; | 66 | ah->dev = dev; |
66 | ah->last_send = 0; | 67 | ah->last_send = 0; |
67 | kref_init(&ah->ref); | 68 | kref_init(&ah->ref); |
68 | 69 | ||
69 | ah->ah = ib_create_ah(pd, attr); | 70 | vah = ib_create_ah(pd, attr); |
70 | if (IS_ERR(ah->ah)) { | 71 | if (IS_ERR(vah)) { |
71 | kfree(ah); | 72 | kfree(ah); |
72 | ah = NULL; | 73 | ah = (struct ipoib_ah *)vah; |
73 | } else | 74 | } else { |
75 | ah->ah = vah; | ||
74 | ipoib_dbg(netdev_priv(dev), "Created ah %p\n", ah->ah); | 76 | ipoib_dbg(netdev_priv(dev), "Created ah %p\n", ah->ah); |
77 | } | ||
75 | 78 | ||
76 | return ah; | 79 | return ah; |
77 | } | 80 | } |