]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
IPoIB: Fix error path in ipoib_mcast_dev_flush()
authorEli Cohen <eli@mellanox.co.il>
Tue, 10 Jan 2006 15:42:14 +0000 (07:42 -0800)
committerRoland Dreier <rolandd@cisco.com>
Tue, 10 Jan 2006 15:42:14 +0000 (07:42 -0800)
Don't leak memory on allocation failure for broadcast mcast group.
Also, print a warning to match handling for other mcast groups.

Signed-off-by: Eli Cohen <eli@mellanox.co.il>
Signed-off-by: Michael S. Tsirkin <mst@mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
drivers/infiniband/ulp/ipoib/ipoib_multicast.c

index ed0c2ead8bc16f0c215a054f0c765d4d2a440eee..6c6db759e79eeaa10a3e7a5db0ad614d4390d2c5 100644 (file)
@@ -780,9 +780,11 @@ void ipoib_mcast_dev_flush(struct net_device *dev)
                                        &priv->multicast_tree);
 
                        list_add_tail(&priv->broadcast->list, &remove_list);
-               }
-
-               priv->broadcast = nmcast;
+                       priv->broadcast = nmcast;
+               } else
+                       ipoib_warn(priv, "could not reallocate broadcast group "
+                                         IPOIB_GID_FMT "\n",
+                                         IPOIB_GID_ARG(priv->broadcast->mcmember.mgid));
        }
 
        spin_unlock_irqrestore(&priv->lock, flags);