netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: ycaibb <ycaibb@gmail.com>
To: davem@davemloft.net, yoshfuji@linux-ipv6.org, dsahern@kernel.org,
	kuba@kernel.org
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, ycaibb@gmail.com
Subject: [PATCH] inet: missing lock releases in igmp.c
Date: Fri, 21 Jan 2022 11:19:11 +0800	[thread overview]
Message-ID: <20220121031911.5570-1-ycaibb@gmail.com> (raw)

From: Ryan Cai <ycaibb@gmail.com>

In method igmp_mcf_get_next, the lock state->im->lock is not released when likely(psf) returns true.

Signed-off-by: Ryan Cai <ycaibb@gmail.com>
---
 net/ipv4/igmp.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c
index d2e2b3d18c66..db6c7bfba1b8 100644
--- a/net/ipv4/igmp.c
+++ b/net/ipv4/igmp.c
@@ -2903,6 +2903,7 @@ static inline struct ip_sf_list *igmp_mcf_get_first(struct seq_file *seq)
 			if (likely(psf)) {
 				state->im = im;
 				state->idev = idev;
+				spin_unlock_bh(&im->lock);
 				break;
 			}
 			spin_unlock_bh(&im->lock);
-- 
2.33.0


             reply	other threads:[~2022-01-21  3:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-21  3:19 ycaibb [this message]
2022-01-26 15:03 ` [inet] 92768196fd: BUG:sleeping_function_called_from_invalid_context_at_lib/iov_iter.c kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220121031911.5570-1-ycaibb@gmail.com \
    --to=ycaibb@gmail.com \
    --cc=davem@davemloft.net \
    --cc=dsahern@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=yoshfuji@linux-ipv6.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).