diff options
Diffstat (limited to 'arch/alpha/kernel/osf_sys.c')
-rw-r--r-- | arch/alpha/kernel/osf_sys.c | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/arch/alpha/kernel/osf_sys.c b/arch/alpha/kernel/osf_sys.c index 9eb090582cf1..1e6956a90608 100644 --- a/arch/alpha/kernel/osf_sys.c +++ b/arch/alpha/kernel/osf_sys.c | |||
@@ -793,8 +793,7 @@ SYSCALL_DEFINE5(osf_getsysinfo, unsigned long, op, void __user *, buffer, | |||
793 | case GSI_UACPROC: | 793 | case GSI_UACPROC: |
794 | if (nbytes < sizeof(unsigned int)) | 794 | if (nbytes < sizeof(unsigned int)) |
795 | return -EINVAL; | 795 | return -EINVAL; |
796 | w = (current_thread_info()->flags >> ALPHA_UAC_SHIFT) & | 796 | w = current_thread_info()->status & UAC_BITMASK; |
797 | UAC_BITMASK; | ||
798 | if (put_user(w, (unsigned int __user *)buffer)) | 797 | if (put_user(w, (unsigned int __user *)buffer)) |
799 | return -EFAULT; | 798 | return -EFAULT; |
800 | return 1; | 799 | return 1; |
@@ -904,24 +903,20 @@ SYSCALL_DEFINE5(osf_setsysinfo, unsigned long, op, void __user *, buffer, | |||
904 | break; | 903 | break; |
905 | 904 | ||
906 | case SSI_NVPAIRS: { | 905 | case SSI_NVPAIRS: { |
907 | unsigned long v, w, i; | 906 | unsigned __user *p = buffer; |
908 | unsigned int old, new; | 907 | unsigned i; |
909 | 908 | ||
910 | for (i = 0; i < nbytes; ++i) { | 909 | for (i = 0, p = buffer; i < nbytes; ++i, p += 2) { |
910 | unsigned v, w, status; | ||
911 | 911 | ||
912 | if (get_user(v, 2*i + (unsigned int __user *)buffer)) | 912 | if (get_user(v, p) || get_user(w, p + 1)) |
913 | return -EFAULT; | ||
914 | if (get_user(w, 2*i + 1 + (unsigned int __user *)buffer)) | ||
915 | return -EFAULT; | 913 | return -EFAULT; |
916 | switch (v) { | 914 | switch (v) { |
917 | case SSIN_UACPROC: | 915 | case SSIN_UACPROC: |
918 | again: | 916 | w &= UAC_BITMASK; |
919 | old = current_thread_info()->flags; | 917 | status = current_thread_info()->status; |
920 | new = old & ~(UAC_BITMASK << ALPHA_UAC_SHIFT); | 918 | status = (status & ~UAC_BITMASK) | w; |
921 | new = new | (w & UAC_BITMASK) << ALPHA_UAC_SHIFT; | 919 | current_thread_info()->status = status; |
922 | if (cmpxchg(¤t_thread_info()->flags, | ||
923 | old, new) != old) | ||
924 | goto again; | ||
925 | break; | 920 | break; |
926 | 921 | ||
927 | default: | 922 | default: |