[openib-general] [PATCH]IPOIB: delete neigh from the list before kfree(neigh)
Shirley Ma
xma at us.ibm.com
Thu Feb 17 17:20:51 PST 2005
This patch sets caller's ah to NULL when calling ipoib_put_ah(), and
deletes neigh from the list before kfree(neigh).
Please review this patch.
diff -urN infiniband/ulp/ipoib/ipoib_main.c
infiniband-ah/ulp/ipoib/ipoib_main.c
--- infiniband/ulp/ipoib/ipoib_main.c 2005-02-17 17:24:56.000000000
+0000
+++ infiniband-ah/ulp/ipoib/ipoib_main.c 2005-02-18
01:15:44.000000000 +0000
@@ -225,16 +225,20 @@
dev_kfree_skb_irq(skb);
list_for_each_entry_safe(neigh, tn, &path->neigh_list, list) {
- if (neigh->ah)
+ if (neigh->ah) {
ipoib_put_ah(neigh->ah);
+ neigh->bh = NULL;
+ }
+ list_del(&neigh->list);
*to_ipoib_neigh(neigh->neighbour) = NULL;
neigh->neighbour->ops->destructor = NULL;
kfree(neigh);
}
- if (path->ah)
+ if (path->ah) {
ipoib_put_ah(path->ah);
-
+ path->ah = NULL;
+ }
rb_erase(&path->rb_node, &priv->path_tree);
list_del(&path->list);
kfree(path);
diff -urN infiniband/ulp/ipoib/ipoib_multicast.c
infiniband-ah/ulp/ipoib/ipoib_multicast.c
--- infiniband/ulp/ipoib/ipoib_multicast.c 2005-02-17
17:24:56.000000000 +0000
+++ infiniband-ah/ulp/ipoib/ipoib_multicast.c 2005-02-18
00:36:56.000000000 +0000
@@ -101,7 +101,11 @@
spin_lock_irqsave(&priv->lock, flags);
list_for_each_entry_safe(neigh, tmp, &mcast->neigh_list, list) {
- ipoib_put_ah(neigh->ah);
+ if (neigh->ah) {
+ ipoib_put_ah(neigh->ah);
+ neigh->bh = NULL;
+ }
+ list_del(&neigh->list);
*to_ipoib_neigh(neigh->neighbour) = NULL;
neigh->neighbour->ops->destructor = NULL;
kfree(neigh);
@@ -109,8 +113,10 @@
spin_unlock_irqrestore(&priv->lock, flags);
- if (mcast->ah)
+ if (mcast->ah) {
ipoib_put_ah(mcast->ah);
+ mcast->ah = NULL;
+ }
while (!skb_queue_empty(&mcast->pkt_queue)) {
struct sk_buff *skb = skb_dequeue(&mcast->pkt_queue);
Thanks
Shirley Ma
IBM Linux Technology Center
15300 SW Koll Parkway
Beaverton, OR 97006-6063
Phone(Fax): (503) 578-7638
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/general/attachments/20050217/b5f6fc9b/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: infiniband-ah.patch
Type: application/octet-stream
Size: 1643 bytes
Desc: not available
URL: <http://lists.openfabrics.org/pipermail/general/attachments/20050217/b5f6fc9b/attachment.obj>
More information about the general
mailing list