aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/ulp/ipoib
diff options
context:
space:
mode:
authorRoland Dreier <rolandd@cisco.com>2006-12-12 17:48:18 -0500
committerRoland Dreier <rolandd@cisco.com>2006-12-12 17:48:18 -0500
commit82b399133b6ebf667ee635fc69ef26b61eede4bc (patch)
tree83477ce12afd3d45397c4480426ae34a5effedd9 /drivers/infiniband/ulp/ipoib
parent5180311fe93842e9e16eb7297cfc4aded752ab33 (diff)
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: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband/ulp/ipoib')
-rw-r--r--drivers/infiniband/ulp/ipoib/ipoib_main.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c
index c09280243726..705eb1d0e554 100644
--- a/drivers/infiniband/ulp/ipoib/ipoib_main.c
+++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c
@@ -497,8 +497,6 @@ static void neigh_add_path(struct sk_buff *skb, struct net_device *dev)
497 return; 497 return;
498 } 498 }
499 499
500 skb_queue_head_init(&neigh->queue);
501
502 /* 500 /*
503 * We can only be called from ipoib_start_xmit, so we're 501 * We can only be called from ipoib_start_xmit, so we're
504 * inside tx_lock -- no need to save/restore flags. 502 * inside tx_lock -- no need to save/restore flags.
@@ -806,6 +804,7 @@ struct ipoib_neigh *ipoib_neigh_alloc(struct neighbour *neighbour)
806 804
807 neigh->neighbour = neighbour; 805 neigh->neighbour = neighbour;
808 *to_ipoib_neigh(neighbour) = neigh; 806 *to_ipoib_neigh(neighbour) = neigh;
807 skb_queue_head_init(&neigh->queue);
809 808
810 return neigh; 809 return neigh;
811} 810}