summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2016-08-22 00:23:07 -0400
committerBen Hutchings <ben@decadent.org.uk>2016-11-20 01:01:40 +0000
commite258d3404fe81d8dd51a9a5e1b0312bfbb732d31 (patch)
treeac632ccdf0a5cd7e7dd8f527b5552dc8bb388be5
parent6089b5ee9c5f2de2bae342da15afe8d4124b9ebe (diff)
downloadlwn-e258d3404fe81d8dd51a9a5e1b0312bfbb732d31.tar.gz
lwn-e258d3404fe81d8dd51a9a5e1b0312bfbb732d31.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> [bwh: Backported to 3.2: adjust context] Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
-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 8303ac481034..43c2a0df4368 100644
--- a/arch/sparc/include/asm/uaccess_32.h
+++ b/arch/sparc/include/asm/uaccess_32.h
@@ -264,8 +264,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)