summaryrefslogtreecommitdiff
path: root/arch/parisc/lib/checksum.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2020-02-18 21:01:02 +0300
committerAl Viro <viro@zeniv.linux.org.uk>2020-05-29 23:11:49 +0300
commit77a8710ba7ef7ffcb71f0618bddf78c1b04f01d3 (patch)
treeda070d513882510df04191e3c3bda35473fcd328 /arch/parisc/lib/checksum.c
parent808b49da54e640cba5c5c92dee658018a529226b (diff)
downloadlinux-77a8710ba7ef7ffcb71f0618bddf78c1b04f01d3.tar.xz
parisc: turn csum_partial_copy_from_user() into csum_and_copy_from_user()
Already has the right semantics. Incidentally. failing copy_from_user() zeroes the tail of destination - no need to repeat that manually Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'arch/parisc/lib/checksum.c')
-rw-r--r--arch/parisc/lib/checksum.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/arch/parisc/lib/checksum.c b/arch/parisc/lib/checksum.c
index 256322c7b648..4e47c2ff2bcd 100644
--- a/arch/parisc/lib/checksum.c
+++ b/arch/parisc/lib/checksum.c
@@ -128,18 +128,12 @@ EXPORT_SYMBOL(csum_partial_copy_nocheck);
* Copy from userspace and compute checksum. If we catch an exception
* then zero the rest of the buffer.
*/
-__wsum csum_partial_copy_from_user(const void __user *src,
+__wsum csum_and_copy_from_user(const void __user *src,
void *dst, int len,
__wsum sum, int *err_ptr)
{
- int missing;
-
- missing = copy_from_user(dst, src, len);
- if (missing) {
- memset(dst + len - missing, 0, missing);
+ if (copy_from_user(dst, src, len))
*err_ptr = -EFAULT;
- }
-
return csum_partial(dst, len, sum);
}
-EXPORT_SYMBOL(csum_partial_copy_from_user);
+EXPORT_SYMBOL(csum_and_copy_from_user);