summaryrefslogtreecommitdiffstats
path: root/kernel/arch/avr32/include
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/arch/avr32/include')
-rw-r--r--kernel/arch/avr32/include/asm/uaccess.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/kernel/arch/avr32/include/asm/uaccess.h b/kernel/arch/avr32/include/asm/uaccess.h
index 68cf638fa..b1ec1fa06 100644
--- a/kernel/arch/avr32/include/asm/uaccess.h
+++ b/kernel/arch/avr32/include/asm/uaccess.h
@@ -74,7 +74,7 @@ extern __kernel_size_t __copy_user(void *to, const void *from,
extern __kernel_size_t copy_to_user(void __user *to, const void *from,
__kernel_size_t n);
-extern __kernel_size_t copy_from_user(void *to, const void __user *from,
+extern __kernel_size_t ___copy_from_user(void *to, const void __user *from,
__kernel_size_t n);
static inline __kernel_size_t __copy_to_user(void __user *to, const void *from,
@@ -88,6 +88,15 @@ static inline __kernel_size_t __copy_from_user(void *to,
{
return __copy_user(to, (const void __force *)from, n);
}
+static inline __kernel_size_t copy_from_user(void *to,
+ const void __user *from,
+ __kernel_size_t n)
+{
+ size_t res = ___copy_from_user(to, from, n);
+ if (unlikely(res))
+ memset(to + (n - res), 0, res);
+ return res;
+}
#define __copy_to_user_inatomic __copy_to_user
#define __copy_from_user_inatomic __copy_from_user