diff options
Diffstat (limited to 'drivers/infiniband/ulp/ipoib/ipoib_main.c')
-rw-r--r-- | drivers/infiniband/ulp/ipoib/ipoib_main.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c index 0bd2a4ff0842..353c13b91e8f 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_main.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c | |||
@@ -660,8 +660,12 @@ static void unicast_arp_send(struct sk_buff *skb, struct net_device *dev, | |||
660 | 660 | ||
661 | path = __path_find(dev, phdr->hwaddr + 4); | 661 | path = __path_find(dev, phdr->hwaddr + 4); |
662 | if (!path || !path->valid) { | 662 | if (!path || !path->valid) { |
663 | if (!path) | 663 | int new_path = 0; |
664 | |||
665 | if (!path) { | ||
664 | path = path_rec_create(dev, phdr->hwaddr + 4); | 666 | path = path_rec_create(dev, phdr->hwaddr + 4); |
667 | new_path = 1; | ||
668 | } | ||
665 | if (path) { | 669 | if (path) { |
666 | /* put pseudoheader back on for next time */ | 670 | /* put pseudoheader back on for next time */ |
667 | skb_push(skb, sizeof *phdr); | 671 | skb_push(skb, sizeof *phdr); |
@@ -669,7 +673,8 @@ static void unicast_arp_send(struct sk_buff *skb, struct net_device *dev, | |||
669 | 673 | ||
670 | if (!path->query && path_rec_start(dev, path)) { | 674 | if (!path->query && path_rec_start(dev, path)) { |
671 | spin_unlock_irqrestore(&priv->lock, flags); | 675 | spin_unlock_irqrestore(&priv->lock, flags); |
672 | path_free(dev, path); | 676 | if (new_path) |
677 | path_free(dev, path); | ||
673 | return; | 678 | return; |
674 | } else | 679 | } else |
675 | __path_add(dev, path); | 680 | __path_add(dev, path); |