forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-04 1543e317f1da31b75942316931e8f491a8920811
kernel/arch/nds32/include/asm/futex.h
....@@ -1,4 +1,4 @@
1
-// SPDX-License-Identifier: GPL-2.0
1
+/* SPDX-License-Identifier: GPL-2.0 */
22 // Copyright (C) 2005-2017 Andes Technology Corporation
33
44 #ifndef __NDS32_FUTEX_H__
....@@ -40,7 +40,7 @@
4040 int ret = 0;
4141 u32 val, tmp, flags;
4242
43
- if (!access_ok(VERIFY_WRITE, uaddr, sizeof(u32)))
43
+ if (!access_ok(uaddr, sizeof(u32)))
4444 return -EFAULT;
4545
4646 smp_mb();
....@@ -66,8 +66,8 @@
6666 {
6767 int oldval = 0, ret;
6868
69
-
70
- pagefault_disable();
69
+ if (!access_ok(uaddr, sizeof(u32)))
70
+ return -EFAULT;
7171 switch (op) {
7272 case FUTEX_OP_SET:
7373 __futex_atomic_op("move %0, %3", ret, oldval, tmp, uaddr,
....@@ -92,8 +92,6 @@
9292 default:
9393 ret = -ENOSYS;
9494 }
95
-
96
- pagefault_enable();
9795
9896 if (!ret)
9997 *oval = oldval;