From: Al Viro Date: Tue, 18 Feb 2020 19:18:09 +0000 (-0500) Subject: sh32: convert to csum_and_copy_from_user() X-Git-Tag: v5.8-rc1~210^2~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7fe8970a78a1934545d53267281f1737eefea3bb;p=thirdparty%2Fkernel%2Flinux.git sh32: convert to csum_and_copy_from_user() Signed-off-by: Al Viro --- diff --git a/arch/sh/include/asm/checksum_32.h b/arch/sh/include/asm/checksum_32.h index 36b84cfd3f673..91571a42e44ed 100644 --- a/arch/sh/include/asm/checksum_32.h +++ b/arch/sh/include/asm/checksum_32.h @@ -48,12 +48,17 @@ __wsum csum_partial_copy_nocheck(const void *src, void *dst, return csum_partial_copy_generic(src, dst, len, sum, NULL, NULL); } +#define _HAVE_ARCH_COPY_AND_CSUM_FROM_USER static inline -__wsum csum_partial_copy_from_user(const void __user *src, void *dst, +__wsum csum_and_copy_from_user(const void __user *src, void *dst, int len, __wsum sum, int *err_ptr) { - return csum_partial_copy_generic((__force const void *)src, dst, + if (access_ok(src, len)) + return csum_partial_copy_generic((__force const void *)src, dst, len, sum, err_ptr, NULL); + if (len) + *err_ptr = -EFAULT; + return sum; } /*