diff options
author | Ralf Baechle <ralf@linux-mips.org> | 1998-09-19 19:15:08 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 1998-09-19 19:15:08 +0000 |
commit | 03ba4131783cc9e872f8bb26a03f15bc11f27564 (patch) | |
tree | 88db8dba75ae06ba3bad08e42c5e52efc162535c /include/asm-ppc/uaccess.h | |
parent | 257730f99381dd26e10b832fce4c94cae7ac1176 (diff) |
- Merge with Linux 2.1.121.
- Bugfixes.
Diffstat (limited to 'include/asm-ppc/uaccess.h')
-rw-r--r-- | include/asm-ppc/uaccess.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/include/asm-ppc/uaccess.h b/include/asm-ppc/uaccess.h index df3d3d591..65ca165b7 100644 --- a/include/asm-ppc/uaccess.h +++ b/include/asm-ppc/uaccess.h @@ -211,9 +211,12 @@ extern int __copy_tofrom_user(void *to, const void *from, unsigned long size); extern inline unsigned long copy_from_user(void *to, const void *from, unsigned long n) { - if (access_ok(VERIFY_READ, from, n)) - return __copy_tofrom_user(to, from, n); - return n? -EFAULT: 0; + unsigned long res = n; + if (access_ok(VERIFY_READ, from, n)) { + res = __copy_tofrom_user(to, from, n); + if (res) memset((char *)to + n - res, 0, res); + } + return res; } extern inline unsigned long @@ -221,7 +224,7 @@ copy_to_user(void *to, const void *from, unsigned long n) { if (access_ok(VERIFY_WRITE, to, n)) return __copy_tofrom_user(to, from, n); - return n? -EFAULT: 0; + return n; } #define __copy_from_user(to, from, size) \ |