summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2016-08-22 00:23:07 -0400
committerJiri Slaby <jslaby@suse.cz>2016-09-29 11:14:38 +0200
commit0ed3b0d5028684292100726687b725d541e5a34e (patch)
tree3a0be516259389b80b95fcfa32fded6f261dd9c3
parentb8d635cfa41503774d0655d2ad09b12e444167bd (diff)
downloadlwn-0ed3b0d5028684292100726687b725d541e5a34e.tar.gz
lwn-0ed3b0d5028684292100726687b725d541e5a34e.zip
sparc32: fix copy_from_user()
commit 917400cecb4b52b5cde5417348322bb9c8272fa6 upstream. Acked-by: David S. Miller <davem@davemloft.net> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Jiri Slaby <jslaby@suse.cz>
-rw-r--r--arch/sparc/include/asm/uaccess_32.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/sparc/include/asm/uaccess_32.h b/arch/sparc/include/asm/uaccess_32.h
index 53a28dd59f59..01f602858de1 100644
--- a/arch/sparc/include/asm/uaccess_32.h
+++ b/arch/sparc/include/asm/uaccess_32.h
@@ -265,8 +265,10 @@ static inline unsigned long copy_from_user(void *to, const void __user *from, un
{
if (n && __access_ok((unsigned long) from, n))
return __copy_user((__force void __user *) to, from, n);
- else
+ else {
+ memset(to, 0, n);
return n;
+ }
}
static inline unsigned long __copy_from_user(void *to, const void __user *from, unsigned long n)