summaryrefslogtreecommitdiffstats
path: root/arch/alpha/include/asm/uaccess.h
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2016-09-20 23:20:32 +0200
committerThomas Gleixner <tglx@linutronix.de>2016-09-20 23:20:32 +0200
commit464b5847e61085f81bb99ce48eb427a0dc7617dc (patch)
tree805c97855a9a13c06910687bbbbe3eb7bc371902 /arch/alpha/include/asm/uaccess.h
parent0a30d69195604f136a4e3bfaf453f742e583ce95 (diff)
parente875bd66dfb68f4e898e9a43ef42858c504a7f23 (diff)
downloadblackbird-op-linux-464b5847e61085f81bb99ce48eb427a0dc7617dc.tar.gz
blackbird-op-linux-464b5847e61085f81bb99ce48eb427a0dc7617dc.zip
Merge branch 'irq/urgent' into irq/core
Merge urgent fixes so pending patches for 4.9 can be applied.
Diffstat (limited to 'arch/alpha/include/asm/uaccess.h')
-rw-r--r--arch/alpha/include/asm/uaccess.h19
1 files changed, 8 insertions, 11 deletions
diff --git a/arch/alpha/include/asm/uaccess.h b/arch/alpha/include/asm/uaccess.h
index c419b43c461d..466e42e96bfa 100644
--- a/arch/alpha/include/asm/uaccess.h
+++ b/arch/alpha/include/asm/uaccess.h
@@ -371,14 +371,6 @@ __copy_tofrom_user_nocheck(void *to, const void *from, long len)
return __cu_len;
}
-extern inline long
-__copy_tofrom_user(void *to, const void *from, long len, const void __user *validate)
-{
- if (__access_ok((unsigned long)validate, len, get_fs()))
- len = __copy_tofrom_user_nocheck(to, from, len);
- return len;
-}
-
#define __copy_to_user(to, from, n) \
({ \
__chk_user_ptr(to); \
@@ -393,17 +385,22 @@ __copy_tofrom_user(void *to, const void *from, long len, const void __user *vali
#define __copy_to_user_inatomic __copy_to_user
#define __copy_from_user_inatomic __copy_from_user
-
extern inline long
copy_to_user(void __user *to, const void *from, long n)
{
- return __copy_tofrom_user((__force void *)to, from, n, to);
+ if (likely(__access_ok((unsigned long)to, n, get_fs())))
+ n = __copy_tofrom_user_nocheck((__force void *)to, from, n);
+ return n;
}
extern inline long
copy_from_user(void *to, const void __user *from, long n)
{
- return __copy_tofrom_user(to, (__force void *)from, n, from);
+ 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;
}
extern void __do_clear_user(void);
OpenPOWER on IntegriCloud