提交 9cb2feb4 编写于 作者: S Stafford Horne 提交者: Linus Torvalds

arch/openrisc: Fix issues with access_ok()

The commit 594cc251 ("make 'user_access_begin()' do 'access_ok()'")
exposed incorrect implementations of access_ok() macro in several
architectures.  This change fixes 2 issues found in OpenRISC.

OpenRISC was not properly using parenthesis for arguments and also using
arguments twice.  This patch fixes those 2 issues.

I test booted this patch with v5.0-rc1 on qemu and it's working fine.

Cc: Guenter Roeck <linux@roeck-us.net>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Reported-by: NLinus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: NStafford Horne <shorne@gmail.com>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 7b558513
......@@ -58,8 +58,12 @@
/* Ensure that addr is below task's addr_limit */
#define __addr_ok(addr) ((unsigned long) addr < get_fs())
#define access_ok(addr, size) \
__range_ok((unsigned long)addr, (unsigned long)size)
#define access_ok(addr, size) \
({ \
unsigned long __ao_addr = (unsigned long)(addr); \
unsigned long __ao_size = (unsigned long)(size); \
__range_ok(__ao_addr, __ao_size); \
})
/*
* These are the main single-value transfer routines. They automatically
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册