Commit 6de81788 authored by Al Viro's avatar Al Viro Committed by Greg Kroah-Hartman

sparc32: fix copy_from_user()

commit 917400ce upstream.
Acked-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 22782f04
...@@ -328,8 +328,10 @@ static inline unsigned long copy_from_user(void *to, const void __user *from, un ...@@ -328,8 +328,10 @@ static inline unsigned long copy_from_user(void *to, const void __user *from, un
{ {
if (n && __access_ok((unsigned long) from, n)) if (n && __access_ok((unsigned long) from, n))
return __copy_user((__force void __user *) to, from, n); return __copy_user((__force void __user *) to, from, n);
else else {
memset(to, 0, n);
return n; return n;
}
} }
static inline unsigned long __copy_from_user(void *to, const void __user *from, unsigned long n) static inline unsigned long __copy_from_user(void *to, const void __user *from, unsigned long n)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment