]> git.hungrycats.org Git - linux/commitdiff
sparc32: fix copy_from_user()
authorAl Viro <viro@zeniv.linux.org.uk>
Mon, 22 Aug 2016 04:23:07 +0000 (00:23 -0400)
committerBen Hutchings <ben@decadent.org.uk>
Sun, 20 Nov 2016 01:17:30 +0000 (01:17 +0000)
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.16: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
arch/sparc/include/asm/uaccess_32.h

index 9634d086fc562f1c128bddb08961d489526abdc1..79b03872e165b27055c6514b4d4ce043fdbc39e9 100644 (file)
@@ -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)