From 001c1a655f0a4e4ebe5d9beb47466dc5c6ab4871 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sat, 25 Apr 2020 18:01:30 -0400 Subject: [PATCH] default csum_and_copy_to_user(): don't bother with access_ok() Signed-off-by: Al Viro --- include/net/checksum.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/include/net/checksum.h b/include/net/checksum.h index 5f9c73c0eeb9..46754ba9d7b7 100644 --- a/include/net/checksum.h +++ b/include/net/checksum.h @@ -38,10 +38,8 @@ static __inline__ __wsum csum_and_copy_to_user { sum = csum_partial(src, len, sum); - if (access_ok(dst, len)) { - if (copy_to_user(dst, src, len) == 0) - return sum; - } + if (copy_to_user(dst, src, len) == 0) + return sum; if (len) *err_ptr = -EFAULT;