lkml.org 
[lkml]   [2022]   [Jan]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] inet: missing lock releases in udp.c
Date
From: Ryan Cai <ycaibb@gmail.com>

In method udp_get_first, the lock hslot->lock is not released when afinfo->family == AF_UNSPEC || sk->sk_family == afinfo->family is true. This patch fixes the problem by adding the unlock statement.

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

diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index 23b05e28490b..f7d573ecaafb 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -2967,6 +2967,7 @@ static struct sock *udp_get_first(struct seq_file *seq, int start)
continue;
if (afinfo->family == AF_UNSPEC ||
sk->sk_family == afinfo->family)
+ spin_unlock_bh(&hslot->lock);
goto found;
}
spin_unlock_bh(&hslot->lock);
--
2.33.0
\
 
 \ /
  Last update: 2022-01-21 04:17    [W:0.060 / U:0.720 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site