diff options
author | Glauber Costa <gcosta@redhat.com> | 2008-06-25 11:57:33 -0300 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-07-09 09:14:23 +0200 |
commit | 6fd4725d75c5049641640ce23fa5896501dfbd42 (patch) | |
tree | 58f09fb54ee3ce558c9f2acc42661a402e88b40d /include | |
parent | dc70ddf4098de043ac52f623c7573a11f2ae3d09 (diff) | |
download | linux-3.10-6fd4725d75c5049641640ce23fa5896501dfbd42.tar.gz linux-3.10-6fd4725d75c5049641640ce23fa5896501dfbd42.tar.bz2 linux-3.10-6fd4725d75c5049641640ce23fa5896501dfbd42.zip |
x86: don't always use EFAULT on __get_user_size.
Let the user of the macro specify the desired return.
Signed-off-by: Glauber Costa <gcosta@redhat.com>
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-x86/uaccess_64.h | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/include/asm-x86/uaccess_64.h b/include/asm-x86/uaccess_64.h index 42c01aa70e7..e0875d7ae89 100644 --- a/include/asm-x86/uaccess_64.h +++ b/include/asm-x86/uaccess_64.h @@ -61,27 +61,27 @@ extern void __put_user_bad(void); ({ \ int __gu_err; \ unsigned long __gu_val; \ - __get_user_size(__gu_val, (ptr), (size), __gu_err); \ + __get_user_size(__gu_val, (ptr), (size), __gu_err, -EFAULT);\ (x) = (__force typeof(*(ptr)))__gu_val; \ __gu_err; \ }) -#define __get_user_size(x, ptr, size, retval) \ +#define __get_user_size(x, ptr, size, retval, errret) \ do { \ retval = 0; \ __chk_user_ptr(ptr); \ switch (size) { \ case 1: \ - __get_user_asm(x, ptr, retval, "b", "b", "=q", -EFAULT);\ + __get_user_asm(x, ptr, retval, "b", "b", "=q", errret);\ break; \ case 2: \ - __get_user_asm(x, ptr, retval, "w", "w", "=r", -EFAULT);\ + __get_user_asm(x, ptr, retval, "w", "w", "=r", errret);\ break; \ case 4: \ - __get_user_asm(x, ptr, retval, "l", "k", "=r", -EFAULT);\ + __get_user_asm(x, ptr, retval, "l", "k", "=r", errret);\ break; \ case 8: \ - __get_user_asm(x, ptr, retval, "q", "", "=r", -EFAULT); \ + __get_user_asm(x, ptr, retval, "q", "", "=r", errret); \ break; \ default: \ (x) = __get_user_bad(); \ |