IPoIB: Fix error path in ipoib_mcast_dev_flush()

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>

authored by

Eli Cohen and committed by
Roland Dreier
70b4c8cd cf311cd4

+5 -3
+5 -3
drivers/infiniband/ulp/ipoib/ipoib_multicast.c
··· 780 780 &priv->multicast_tree); 781 781 782 782 list_add_tail(&priv->broadcast->list, &remove_list); 783 - } 784 - 785 - priv->broadcast = nmcast; 783 + priv->broadcast = nmcast; 784 + } else 785 + ipoib_warn(priv, "could not reallocate broadcast group " 786 + IPOIB_GID_FMT "\n", 787 + IPOIB_GID_ARG(priv->broadcast->mcmember.mgid)); 786 788 } 787 789 788 790 spin_unlock_irqrestore(&priv->lock, flags);