[RESEND mptcp-next v2 1/2] mptcp: check desc->count in read_sock

Geliang Tang posted 2 patches 4 days, 22 hours ago
[RESEND mptcp-next v2 1/2] mptcp: check desc->count in read_sock
Posted by Geliang Tang 4 days, 22 hours ago
From: Gang Yan <yangang@kylinos.cn>

In __tcp_read_sock(), it checks whether desc->count equals 0 within the
loop and breaks the loop if true. This check should also be synchronized
to __mptcp_read_sock().

Co-developed-by: Geliang Tang <geliang@kernel.org>
Signed-off-by: Geliang Tang <geliang@kernel.org>
Signed-off-by: Gang Yan <yangang@kylinos.cn>
---
 net/mptcp/protocol.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index b5676b37f8f4..dc9fdd664871 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -4384,6 +4384,8 @@ static int __mptcp_read_sock(struct sock *sk, read_descriptor_t *desc,
 		}
 
 		mptcp_eat_recv_skb(sk, skb);
+		if (!desc->count)
+			break;
 	}
 
 	if (noack)
-- 
2.53.0