<br><font size=2 face="sans-serif">Here is the patch against the most recent
bit. Please review it.</font><font size=3> </font>
<br><font size=2 face="sans-serif"><br>
Signed-off-by: Shirley Ma <xma@us.ibm.com></font><font size=3> </font>
<br>
<div>
<br><font size=2 face="sans-serif">diff -urpN infiniband/ulp/ipoib/ipoib_main.c
infiniband-spinlock/ulp/ipoib/ipoib_main.c<br>
--- infiniband/ulp/ipoib/ipoib_main.c        2005-02-24
18:06:15.000000000 +0000<br>
+++ infiniband-spinlock/ulp/ipoib/ipoib_main.c        2005-02-24
18:12:13.000000000 +0000<br>
@@ -220,18 +220,23 @@ static void __path_free(struct net_devic<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 @@ static void ipoib_neigh_destructor(struc<br>
         struct ipoib_neigh *neigh = *to_ipoib_neigh(n);</font>
<br><font size=2 face="sans-serif">         struct
ipoib_dev_priv *priv = netdev_priv(n->dev);<br>
         unsigned long flags;<br>
+        struct ipoib_ah *ah = NULL;<br>
 <br>
         ipoib_dbg(priv,<br>
                  
"neigh_destructor for %06x " IPOIB_GID_FMT "\n",<br>
@@ -670,13 +676,16 @@ static void ipoib_neigh_destructor(struc<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 -urpN infiniband/ulp/ipoib/ipoib_multicast.c infiniband-spinlock/ulp/ipoib/ipoib_multicast.c<br>
--- infiniband/ulp/ipoib/ipoib_multicast.c        2005-02-24
18:06:15.000000000 +0000<br>
+++ infiniband-spinlock/ulp/ipoib/ipoib_multicast.c      
 2005-02-24 18:12:13.000000000 +0000<br>
@@ -93,6 +93,8 @@ static void ipoib_mcast_free(struct ipoi<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;</font>
<br><font size=2 face="sans-serif"> <br>
         ipoib_dbg_mcast(netdev_priv(dev),<br>
                  
      "deleting multicast group " IPOIB_GID_FMT
"\n",<br>
@@ -101,7 +103,8 @@ static void ipoib_mcast_free(struct ipoi<br>
         spin_lock_irqsave(&priv->lock,
flags);<br>
 <br>
         list_for_each_entry_safe(neigh, tmp,
&mcast->neigh_list, list) {<br>
-                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 @@ static void ipoib_mcast_free(struct ipoi<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><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>