From b3347a23ce59ff79cf0ebc06ae9792da61f9cf19 Mon Sep 17 00:00:00 2001 From: Petr Vandrovec Date: Mon, 6 Oct 2003 17:56:33 -0700 Subject: [PATCH] [IPV4]: Fix deadlock on ip_mc_list->lock --- net/ipv4/igmp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c index e5f2e6f6490b4..ab0f4ca19017b 100644 --- a/net/ipv4/igmp.c +++ b/net/ipv4/igmp.c @@ -1391,8 +1391,9 @@ int ip_mc_del_src(struct in_device *in_dev, __u32 *pmca, int sfmode, sf_markstate(pmc); #endif if (!delta) { + err = -EINVAL; if (!pmc->sfcount[sfmode]) - return -EINVAL; + goto out_unlock; pmc->sfcount[sfmode]--; } err = 0; @@ -1423,6 +1424,7 @@ int ip_mc_del_src(struct in_device *in_dev, __u32 *pmca, int sfmode, igmp_ifc_event(pmc->interface); #endif } +out_unlock: spin_unlock_bh(&pmc->lock); return err; } -- 2.53.0