Commit 02413477 authored by Shirley Ma's avatar Shirley Ma Committed by Linus Torvalds

[PATCH] IB/ipoib: small fixes

IPoIB small fixes: Initialize path->ah to NULL, and fix dereference after free
of neigh in error path of neigh_add_path().
Signed-off-by: default avatarShirley Ma <xma@us.ibm.com>
Signed-off-by: default avatarRoland Dreier <roland@topspin.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 881fca9e
...@@ -348,6 +348,7 @@ static struct ipoib_path *path_rec_create(struct net_device *dev, ...@@ -348,6 +348,7 @@ static struct ipoib_path *path_rec_create(struct net_device *dev,
path->dev = dev; path->dev = dev;
path->pathrec.dlid = 0; path->pathrec.dlid = 0;
path->ah = NULL;
skb_queue_head_init(&path->queue); skb_queue_head_init(&path->queue);
...@@ -450,8 +451,8 @@ static void neigh_add_path(struct sk_buff *skb, struct net_device *dev) ...@@ -450,8 +451,8 @@ static void neigh_add_path(struct sk_buff *skb, struct net_device *dev)
err: err:
*to_ipoib_neigh(skb->dst->neighbour) = NULL; *to_ipoib_neigh(skb->dst->neighbour) = NULL;
list_del(&neigh->list); list_del(&neigh->list);
kfree(neigh);
neigh->neighbour->ops->destructor = NULL; neigh->neighbour->ops->destructor = NULL;
kfree(neigh);
++priv->stats.tx_dropped; ++priv->stats.tx_dropped;
dev_kfree_skb_any(skb); dev_kfree_skb_any(skb);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment