Skip to contentSkip to conversation

Squash to "implement mptcp read_sock"

PATCH New Geliang Tang 1 participant 3 messages Jul 3, 2025

Subsystems (3)
lore
Share & tools
lore

Geliang Tang

author reviewer
#0 lore raw

cover Squash to "implement mptcp read_sock"

From: Geliang Tang <[email protected]>

Two small cleanups for "implement mptcp read_sock" v5.

Based-on: <[email protected]>

Geliang Tang (2):
Squash to "mptcp: implement .read_sock"
Squash to "mptcp: set .splice_read"

 net/ipv4/tcp.c       | 2 ++
 net/mptcp/protocol.c | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)
Signature · 1 line
2.48.1
author reviewer
#1 lore raw

PATCH 1/2 Squash to "mptcp: implement .read_sock"

From: Geliang Tang <[email protected]>

No need to init copied to zero.

---
 net/mptcp/protocol.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/mptcp/protocol.c +1 -1
index 068ec724e081..924b4d5bd1af 100644
@@ -3997,7 +3997,7 @@ static int mptcp_read_sock(struct sock *sk, read_descriptor_t *desc,
 	struct scm_timestamping_internal tss;
 	int flags = 0, cmsg_flags = 0;
 	size_t len = sk->sk_rcvbuf;
-	int copied = 0;
+	int copied;
 
 	if (sk->sk_state == TCP_LISTEN)
 		return -ENOTCONN;
Signature · 1 line
2.48.1
author reviewer
#2 lore raw

PATCH 2/2 Squash to "mptcp: set .splice_read"

In reply to Geliang Tang

From: Geliang Tang <[email protected]>

Add NULL pointer checks.

---
 net/ipv4/tcp.c | 2 ++
 1 file changed, 2 insertions(+)
net/ipv4/tcp.c +2 -0
index a627e1ee5668..6fca35f3fd24 100644
@@ -779,6 +779,8 @@ static int __tcp_splice_read(struct sock *sk, struct tcp_splice_state *tss)
 		.count	  = tss->len,
 	};
 
+	if (unlikely(!ops || !ops->read_sock))
+		return -ENOTSUPP;
 	return INDIRECT_CALL_INET_1(ops->read_sock, tcp_read_sock,
 				    sk, &rd_desc, tcp_splice_data_recv);
 }
Signature · 1 line
2.48.1