[PATCH] inet: missing lock releases in igmp.c

From: ycaibb
Date: Thu Jan 20 2022 - 22:19:21 EST


From: Ryan Cai <ycaibb@xxxxxxxxx>

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@xxxxxxxxx>
---
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