diff --git a/net/ipv4/tcp_bpf.c b/net/ipv4/tcp_bpf.c index cd214291290c5b1c4a403d723da04685d316085d..5484a8e677fc5c8f8054e7dd6c3d626ef16acf9d 100644 --- a/net/ipv4/tcp_bpf.c +++ b/net/ipv4/tcp_bpf.c @@ -36,7 +36,8 @@ int __tcp_bpf_recvmsg(struct sock *sk, struct sk_psock *psock, page = sg_page(sge); if (copied + copy > len) copy = len - copied; - copy = copy_page_to_iter(page, sge->offset, copy, iter); + if (copy) + copy = copy_page_to_iter(page, sge->offset, copy, iter); if (!copy) return copied ? copied : -EFAULT;