diff options
Diffstat (limited to 'drivers/infiniband/ulp/ipoib/ipoib_multicast.c')
-rw-r--r-- | drivers/infiniband/ulp/ipoib/ipoib_multicast.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c index fbb95ee538b2..7cecb16d3d48 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c | |||
@@ -658,9 +658,15 @@ static int ipoib_mcast_leave(struct net_device *dev, struct ipoib_mcast *mcast) | |||
658 | void ipoib_mcast_send(struct net_device *dev, void *mgid, struct sk_buff *skb) | 658 | void ipoib_mcast_send(struct net_device *dev, void *mgid, struct sk_buff *skb) |
659 | { | 659 | { |
660 | struct ipoib_dev_priv *priv = netdev_priv(dev); | 660 | struct ipoib_dev_priv *priv = netdev_priv(dev); |
661 | struct dst_entry *dst = skb_dst(skb); | ||
661 | struct ipoib_mcast *mcast; | 662 | struct ipoib_mcast *mcast; |
663 | struct neighbour *n; | ||
662 | unsigned long flags; | 664 | unsigned long flags; |
663 | 665 | ||
666 | n = NULL; | ||
667 | if (dst) | ||
668 | n = dst_neigh_lookup_skb(dst, skb); | ||
669 | |||
664 | spin_lock_irqsave(&priv->lock, flags); | 670 | spin_lock_irqsave(&priv->lock, flags); |
665 | 671 | ||
666 | if (!test_bit(IPOIB_FLAG_OPER_UP, &priv->flags) || | 672 | if (!test_bit(IPOIB_FLAG_OPER_UP, &priv->flags) || |
@@ -715,12 +721,6 @@ void ipoib_mcast_send(struct net_device *dev, void *mgid, struct sk_buff *skb) | |||
715 | 721 | ||
716 | out: | 722 | out: |
717 | if (mcast && mcast->ah) { | 723 | if (mcast && mcast->ah) { |
718 | struct dst_entry *dst = skb_dst(skb); | ||
719 | struct neighbour *n = NULL; | ||
720 | |||
721 | rcu_read_lock(); | ||
722 | if (dst) | ||
723 | n = dst_neigh_lookup_skb(dst, skb); | ||
724 | if (n) { | 724 | if (n) { |
725 | if (!*to_ipoib_neigh(n)) { | 725 | if (!*to_ipoib_neigh(n)) { |
726 | struct ipoib_neigh *neigh; | 726 | struct ipoib_neigh *neigh; |
@@ -735,13 +735,14 @@ out: | |||
735 | } | 735 | } |
736 | neigh_release(n); | 736 | neigh_release(n); |
737 | } | 737 | } |
738 | rcu_read_unlock(); | ||
739 | spin_unlock_irqrestore(&priv->lock, flags); | 738 | spin_unlock_irqrestore(&priv->lock, flags); |
740 | ipoib_send(dev, skb, mcast->ah, IB_MULTICAST_QPN); | 739 | ipoib_send(dev, skb, mcast->ah, IB_MULTICAST_QPN); |
741 | return; | 740 | return; |
742 | } | 741 | } |
743 | 742 | ||
744 | unlock: | 743 | unlock: |
744 | if (n) | ||
745 | neigh_release(n); | ||
745 | spin_unlock_irqrestore(&priv->lock, flags); | 746 | spin_unlock_irqrestore(&priv->lock, flags); |
746 | } | 747 | } |
747 | 748 | ||