Commit 82b39913 authored by Roland Dreier's avatar Roland Dreier

IPoIB: Make sure struct ipoib_neigh.queue is always initialized

Move the initialization of ipoib_neigh's skb_queue into
ipoib_neigh_alloc(), since commit 2745b5b7 ("IPoIB: Fix skb leak when
freeing neighbour") will make iterate over the skb_queue to free any
packets left over when freeing the ipoib_neigh structure.

This fixes a crash when freeing ipoib_neigh structures allocated in
ipoib_mcast_send(), which otherwise don't have their skb_queue
initialized.
Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
parent 5180311f
...@@ -497,8 +497,6 @@ static void neigh_add_path(struct sk_buff *skb, struct net_device *dev) ...@@ -497,8 +497,6 @@ static void neigh_add_path(struct sk_buff *skb, struct net_device *dev)
return; return;
} }
skb_queue_head_init(&neigh->queue);
/* /*
* We can only be called from ipoib_start_xmit, so we're * We can only be called from ipoib_start_xmit, so we're
* inside tx_lock -- no need to save/restore flags. * inside tx_lock -- no need to save/restore flags.
...@@ -806,6 +804,7 @@ struct ipoib_neigh *ipoib_neigh_alloc(struct neighbour *neighbour) ...@@ -806,6 +804,7 @@ struct ipoib_neigh *ipoib_neigh_alloc(struct neighbour *neighbour)
neigh->neighbour = neighbour; neigh->neighbour = neighbour;
*to_ipoib_neigh(neighbour) = neigh; *to_ipoib_neigh(neighbour) = neigh;
skb_queue_head_init(&neigh->queue);
return neigh; return neigh;
} }
......
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