summaryrefslogtreecommitdiffstats
path: root/kernel/arch/sh/include/asm
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/arch/sh/include/asm')
-rw-r--r--kernel/arch/sh/include/asm/uaccess.h5
-rw-r--r--kernel/arch/sh/include/asm/uaccess_64.h1
2 files changed, 5 insertions, 1 deletions
diff --git a/kernel/arch/sh/include/asm/uaccess.h b/kernel/arch/sh/include/asm/uaccess.h
index a49635c51..92ade79ac 100644
--- a/kernel/arch/sh/include/asm/uaccess.h
+++ b/kernel/arch/sh/include/asm/uaccess.h
@@ -151,7 +151,10 @@ copy_from_user(void *to, const void __user *from, unsigned long n)
__kernel_size_t __copy_size = (__kernel_size_t) n;
if (__copy_size && __access_ok(__copy_from, __copy_size))
- return __copy_user(to, from, __copy_size);
+ __copy_size = __copy_user(to, from, __copy_size);
+
+ if (unlikely(__copy_size))
+ memset(to + (n - __copy_size), 0, __copy_size);
return __copy_size;
}
diff --git a/kernel/arch/sh/include/asm/uaccess_64.h b/kernel/arch/sh/include/asm/uaccess_64.h
index c01376c76..ca5073dd4 100644
--- a/kernel/arch/sh/include/asm/uaccess_64.h
+++ b/kernel/arch/sh/include/asm/uaccess_64.h
@@ -24,6 +24,7 @@
#define __get_user_size(x,ptr,size,retval) \
do { \
retval = 0; \
+ x = 0; \
switch (size) { \
case 1: \
retval = __get_user_asm_b((void *)&x, \