summaryrefslogtreecommitdiff
path: root/arch/alpha/include
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2016-10-14 20:42:44 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2016-10-14 20:42:44 -0400
commit2692a71bbd40160165e89d5505c5c28144ec5a42 (patch)
treeacaaf0f1a4942486109094acad37c29456aeda98 /arch/alpha/include
parent7041c57709efdc1e31aaff663cfe17f0b21f4743 (diff)
parentb065444286bed7ec49ee81c593a46f3031fbfc83 (diff)
Merge branch 'work.uaccess' into for-linus
Diffstat (limited to 'arch/alpha/include')
-rw-r--r--arch/alpha/include/asm/uaccess.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/arch/alpha/include/asm/uaccess.h b/arch/alpha/include/asm/uaccess.h
index 466e42e96bfa..94f587535dee 100644
--- a/arch/alpha/include/asm/uaccess.h
+++ b/arch/alpha/include/asm/uaccess.h
@@ -396,11 +396,12 @@ copy_to_user(void __user *to, const void *from, long n)
extern inline long
copy_from_user(void *to, const void __user *from, long n)
{
+ long res = n;
if (likely(__access_ok((unsigned long)from, n, get_fs())))
- n = __copy_tofrom_user_nocheck(to, (__force void *)from, n);
- else
- memset(to, 0, n);
- return n;
+ res = __copy_from_user_inatomic(to, from, n);
+ if (unlikely(res))
+ memset(to + (n - res), 0, res);
+ return res;
}
extern void __do_clear_user(void);