<br><font size=2 face="sans-serif">Sorry, made a mistake in the previous
patch. Here is the right one.</font>
<br>
<div>
<br><font size=2 face="sans-serif">diff -urN infiniband/ulp/ipoib/ipoib_main.c
infiniband-lock/ulp/ipoib/ipoib_main.c<br>
--- infiniband/ulp/ipoib/ipoib_main.c        2005-02-17
17:24:56.000000000 +0000<br>
+++ infiniband-lock/ulp/ipoib/ipoib_main.c        2005-02-18
00:20:10.000000000 +0000<br>
@@ -220,18 +220,23 @@<br>
         struct ipoib_dev_priv *priv = netdev_priv(dev);<br>
         struct ipoib_neigh *neigh, *tn;<br>
         struct sk_buff *skb;<br>
+        LIST_HEAD(ah_list);<br>
+        struct ipoib_ah *ah, *tah;<br>
 <br>
         while ((skb = __skb_dequeue(&path->queue)))<br>
                 dev_kfree_skb_irq(skb);<br>
 <br>
         list_for_each_entry_safe(neigh, tn,
&path->neigh_list, list) {<br>
                 if
(neigh->ah)<br>
-                
       ipoib_put_ah(neigh->ah);<br>
+                
       list_add_tail(&neigh->ah->list,
&ah_list);<br>
                 *to_ipoib_neigh(neigh->neighbour)
= NULL;<br>
                 neigh->neighbour->ops->destructor
= NULL;<br>
                 kfree(neigh);<br>
         }<br>
 <br>
+        list_for_each_entry_safe(ah, tah,
&ah_list, list)<br>
+                ipoib_put_ah(ah);<br>
+<br>
         if (path->ah)<br>
                 ipoib_put_ah(path->ah);<br>
 <br>
@@ -660,6 +665,7 @@<br>
         struct ipoib_neigh *neigh = *to_ipoib_neigh(n);<br>
         struct ipoib_dev_priv *priv = netdev_priv(n->dev);<br>
         unsigned long flags;</font>
<br><font size=2 face="sans-serif">+        struct
ipoib_ah *ah = NULL;<br>
 <br>
         ipoib_dbg(priv,<br>
                  
"neigh_destructor for %06x " IPOIB_GID_FMT "\n",<br>
@@ -670,13 +676,16 @@<br>
 <br>
         if (neigh) {<br>
                 if
(neigh->ah)<br>
-                
       ipoib_put_ah(neigh->ah);<br>
+                
       ah = neigh->ah;<br>
                 list_del(&neigh->list);<br>
                 *to_ipoib_neigh(n)
= NULL;<br>
                 kfree(neigh);<br>
         }<br>
 <br>
         spin_unlock_irqrestore(&priv->lock,
flags);<br>
+        <br>
+        if (ah)<br>
+                ipoib_put_ah(ah);<br>
 }<br>
 <br>
 static int ipoib_neigh_setup(struct neighbour *neigh)<br>
diff -urN infiniband/ulp/ipoib/ipoib_multicast.c infiniband-lock/ulp/ipoib/ipoib_multicast.c<br>
--- infiniband/ulp/ipoib/ipoib_multicast.c        2005-02-17
17:24:56.000000000 +0000<br>
+++ infiniband-lock/ulp/ipoib/ipoib_multicast.c        2005-02-18
00:20:34.000000000 +0000<br>
@@ -93,6 +93,8 @@<br>
         struct ipoib_dev_priv *priv = netdev_priv(dev);<br>
         struct ipoib_neigh *neigh, *tmp;<br>
         unsigned long flags;<br>
+        LIST_HEAD(ah_list);<br>
+        struct ipoib_ah *ah, *tah;<br>
 <br>
         ipoib_dbg_mcast(netdev_priv(dev),<br>
                  
      "deleting multicast group " IPOIB_GID_FMT
"\n",<br>
@@ -101,7 +103,8 @@<br>
         spin_lock_irqsave(&priv->lock,
flags);<br>
 <br>
         list_for_each_entry_safe(neigh, tmp,
&mcast->neigh_list, list) {</font>
<br><font size=2 face="sans-serif">-        
       ipoib_put_ah(neigh->ah);<br>
+                if
(neigh->ah)<br>
+                
       list_add_tail(&neigh->ah->list,
&ah_list);<br>
                 *to_ipoib_neigh(neigh->neighbour)
= NULL;<br>
                 neigh->neighbour->ops->destructor
= NULL;<br>
                 kfree(neigh);<br>
@@ -109,6 +112,9 @@<br>
 <br>
         spin_unlock_irqrestore(&priv->lock,
flags);<br>
 <br>
+        list_for_each_entry_safe(ah, tah,
&ah_list, list)<br>
+                ipoib_put_ah(ah);<br>
+<br>
         if (mcast->ah)<br>
                 ipoib_put_ah(mcast->ah);<br>
 </font>
<br>
<br>
<br>
<br>
<br><font size=2 face="sans-serif"><br>
Thanks<br>
Shirley Ma<br>
IBM Linux Technology Center<br>
15300 SW Koll Parkway<br>
Beaverton, OR 97006-6063<br>
Phone(Fax): (503) 578-7638<br>
<br>
</font></div>