linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] ipv6: mcast: Delay put pmc->idev in mld_del_delrec()
@ 2025-07-14 14:19 Yue Haibing
  2025-07-17  1:40 ` patchwork-bot+netdevbpf
  2025-07-17 14:41 ` [PATCH net] ipv6: mcast: Delay put pmc->idev in mld_del_delrec(): manual merge Matthieu Baerts
  0 siblings, 2 replies; 4+ messages in thread
From: Yue Haibing @ 2025-07-14 14:19 UTC (permalink / raw)
  To: davem, dsahern, edumazet, kuba, pabeni, horms, ap420073
  Cc: netdev, linux-kernel, yuehaibing

pmc->idev is still used in ip6_mc_clear_src(), so as mld_clear_delrec()
does, the reference should be put after ip6_mc_clear_src() return.

Fixes: 63ed8de4be81 ("mld: add mc_lock for protecting per-interface mld data")
Signed-off-by: Yue Haibing <yuehaibing@huawei.com>
---
 net/ipv6/mcast.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c
index 65831b4fee1f..616bf4c0c8fd 100644
--- a/net/ipv6/mcast.c
+++ b/net/ipv6/mcast.c
@@ -807,8 +807,8 @@ static void mld_del_delrec(struct inet6_dev *idev, struct ifmcaddr6 *im)
 		} else {
 			im->mca_crcount = idev->mc_qrv;
 		}
-		in6_dev_put(pmc->idev);
 		ip6_mc_clear_src(pmc);
+		in6_dev_put(pmc->idev);
 		kfree_rcu(pmc, rcu);
 	}
 }
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-07-18  1:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-14 14:19 [PATCH net] ipv6: mcast: Delay put pmc->idev in mld_del_delrec() Yue Haibing
2025-07-17  1:40 ` patchwork-bot+netdevbpf
2025-07-17 14:41 ` [PATCH net] ipv6: mcast: Delay put pmc->idev in mld_del_delrec(): manual merge Matthieu Baerts
2025-07-18  1:33   ` Yue Haibing

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).