Skip to content

Commit

Permalink
default csum_and_copy_to_user(): don't bother with access_ok()
Browse files Browse the repository at this point in the history
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Al Viro committed May 29, 2020
1 parent 5904122 commit 001c1a6
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions include/net/checksum.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 001c1a6

Please sign in to comment.