Skip to content

Commit 0b5c927

Browse files
Christoph Lameterdledford
authored andcommitted
IB/ipoib: For sendonly join free the multicast group on leave
When we leave the multicast group on expiration of a neighbor we do not free the mcast structure. This results in a memory leak that causes ib_dealloc_pd to fail and print a WARN_ON message and backtrace. Fixes: bd99b2e (IB/ipoib: Expire sendonly multicast joins) Signed-off-by: Christoph Lameter <[email protected]> Tested-by: Sagi Grimberg <[email protected]> Signed-off-by: Doug Ledford <[email protected]>
1 parent b8cab5d commit 0b5c927

File tree

3 files changed

+5
-2
lines changed

3 files changed

+5
-2
lines changed

drivers/infiniband/ulp/ipoib/ipoib.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,7 @@ void ipoib_dev_cleanup(struct net_device *dev);
495495
void ipoib_mcast_join_task(struct work_struct *work);
496496
void ipoib_mcast_carrier_on_task(struct work_struct *work);
497497
void ipoib_mcast_send(struct net_device *dev, u8 *daddr, struct sk_buff *skb);
498+
void ipoib_mcast_free(struct ipoib_mcast *mc);
498499

499500
void ipoib_mcast_restart_task(struct work_struct *work);
500501
int ipoib_mcast_start_thread(struct net_device *dev);

drivers/infiniband/ulp/ipoib/ipoib_main.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1207,8 +1207,10 @@ static void __ipoib_reap_neigh(struct ipoib_dev_priv *priv)
12071207

12081208
out_unlock:
12091209
spin_unlock_irqrestore(&priv->lock, flags);
1210-
list_for_each_entry_safe(mcast, tmcast, &remove_list, list)
1210+
list_for_each_entry_safe(mcast, tmcast, &remove_list, list) {
12111211
ipoib_mcast_leave(dev, mcast);
1212+
ipoib_mcast_free(mcast);
1213+
}
12121214
}
12131215

12141216
static void ipoib_reap_neigh(struct work_struct *work)

drivers/infiniband/ulp/ipoib/ipoib_multicast.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ static void __ipoib_mcast_schedule_join_thread(struct ipoib_dev_priv *priv,
106106
queue_delayed_work(priv->wq, &priv->mcast_task, 0);
107107
}
108108

109-
static void ipoib_mcast_free(struct ipoib_mcast *mcast)
109+
void ipoib_mcast_free(struct ipoib_mcast *mcast)
110110
{
111111
struct net_device *dev = mcast->dev;
112112
int tx_dropped = 0;

0 commit comments

Comments
 (0)