diff options
Diffstat (limited to 'drivers/infiniband')
-rw-r--r-- | drivers/infiniband/ulp/ipoib/ipoib_main.c | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c index 19e06bc38b39..dce0443f9d69 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_main.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c | |||
@@ -711,26 +711,26 @@ static int ipoib_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
711 | 711 | ||
712 | neigh = *to_ipoib_neigh(skb->dst->neighbour); | 712 | neigh = *to_ipoib_neigh(skb->dst->neighbour); |
713 | 713 | ||
714 | if (neigh->ah) | 714 | if (unlikely((memcmp(&neigh->dgid.raw, |
715 | if (unlikely((memcmp(&neigh->dgid.raw, | 715 | skb->dst->neighbour->ha + 4, |
716 | skb->dst->neighbour->ha + 4, | 716 | sizeof(union ib_gid))) || |
717 | sizeof(union ib_gid))) || | 717 | (neigh->dev != dev))) { |
718 | (neigh->dev != dev))) { | 718 | spin_lock_irqsave(&priv->lock, flags); |
719 | spin_lock_irqsave(&priv->lock, flags); | 719 | /* |
720 | /* | 720 | * It's safe to call ipoib_put_ah() inside |
721 | * It's safe to call ipoib_put_ah() inside | 721 | * priv->lock here, because we know that |
722 | * priv->lock here, because we know that | 722 | * path->ah will always hold one more reference, |
723 | * path->ah will always hold one more reference, | 723 | * so ipoib_put_ah() will never do more than |
724 | * so ipoib_put_ah() will never do more than | 724 | * decrement the ref count. |
725 | * decrement the ref count. | 725 | */ |
726 | */ | 726 | if (neigh->ah) |
727 | ipoib_put_ah(neigh->ah); | 727 | ipoib_put_ah(neigh->ah); |
728 | list_del(&neigh->list); | 728 | list_del(&neigh->list); |
729 | ipoib_neigh_free(dev, neigh); | 729 | ipoib_neigh_free(dev, neigh); |
730 | spin_unlock_irqrestore(&priv->lock, flags); | 730 | spin_unlock_irqrestore(&priv->lock, flags); |
731 | ipoib_path_lookup(skb, dev); | 731 | ipoib_path_lookup(skb, dev); |
732 | return NETDEV_TX_OK; | 732 | return NETDEV_TX_OK; |
733 | } | 733 | } |
734 | 734 | ||
735 | if (ipoib_cm_get(neigh)) { | 735 | if (ipoib_cm_get(neigh)) { |
736 | if (ipoib_cm_up(neigh)) { | 736 | if (ipoib_cm_up(neigh)) { |