diff options
| -rw-r--r-- | drivers/infiniband/ulp/ipoib/ipoib_ib.c | 13 | ||||
| -rw-r--r-- | drivers/infiniband/ulp/ipoib/ipoib_main.c | 2 | ||||
| -rw-r--r-- | drivers/infiniband/ulp/ipoib/ipoib_multicast.c | 7 |
3 files changed, 14 insertions, 8 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 | } |
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c index 7567b6000230..37c46c66b0f2 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_main.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c | |||
| @@ -432,7 +432,7 @@ static void path_rec_completion(int status, | |||
| 432 | 432 | ||
| 433 | spin_lock_irqsave(&priv->lock, flags); | 433 | spin_lock_irqsave(&priv->lock, flags); |
| 434 | 434 | ||
| 435 | if (ah) { | 435 | if (!IS_ERR_OR_NULL(ah)) { |
| 436 | path->pathrec = *pathrec; | 436 | path->pathrec = *pathrec; |
| 437 | 437 | ||
| 438 | old_ah = path->ah; | 438 | old_ah = path->ah; |
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c index 1b7a97686356..30ca8f069a17 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c | |||
| @@ -240,8 +240,11 @@ static int ipoib_mcast_join_finish(struct ipoib_mcast *mcast, | |||
| 240 | av.grh.dgid = mcast->mcmember.mgid; | 240 | av.grh.dgid = mcast->mcmember.mgid; |
| 241 | 241 | ||
| 242 | ah = ipoib_create_ah(dev, priv->pd, &av); | 242 | ah = ipoib_create_ah(dev, priv->pd, &av); |
| 243 | if (!ah) { | 243 | if (IS_ERR(ah)) { |
| 244 | ipoib_warn(priv, "ib_address_create failed\n"); | 244 | ipoib_warn(priv, "ib_address_create failed %ld\n", |
| 245 | -PTR_ERR(ah)); | ||
| 246 | /* use original error */ | ||
| 247 | return PTR_ERR(ah); | ||
| 245 | } else { | 248 | } else { |
| 246 | spin_lock_irq(&priv->lock); | 249 | spin_lock_irq(&priv->lock); |
| 247 | mcast->ah = ah; | 250 | mcast->ah = ah; |
