From: Liam R. Howlett Date: Thu, 8 Apr 2021 17:16:07 +0000 (-0400) Subject: net/ipv5/tcp: Use vma_lookup() in tcp_zerocopy_receive() X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=3950f2ee185c0f9c0dc85a6239683bfffd59489b;p=users%2Fjedix%2Flinux-maple.git net/ipv5/tcp: Use vma_lookup() in tcp_zerocopy_receive() Clean up code by using vma_lookup() to look up a specific VMA. Signed-off-by: Liam R. Howlett --- diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index e14fd0c50c10..d4781a514012 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -2094,8 +2094,8 @@ static int tcp_zerocopy_receive(struct sock *sk, mmap_read_lock(current->mm); - vma = find_vma(current->mm, address); - if (!vma || vma->vm_start > address || vma->vm_ops != &tcp_vm_ops) { + vma = vma_lookup(current->mm, address); + if (!vma || vma->vm_ops != &tcp_vm_ops) { mmap_read_unlock(current->mm); return -EINVAL; }