Skip to content

Commit

Permalink
IPoIB: Fix error path in ipoib_mcast_dev_flush()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Eli Cohen authored and Roland Dreier committed Jan 10, 2006
1 parent cf311cd commit 70b4c8c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions drivers/infiniband/ulp/ipoib/ipoib_multicast.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 70b4c8c

Please sign in to comment.