aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/include/asm/uaccess.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/arch/x86/include/asm/uaccess.h b/arch/x86/include/asm/uaccess.h
index 84ecf1df2ac6..6f1bb74d547b 100644
--- a/arch/x86/include/asm/uaccess.h
+++ b/arch/x86/include/asm/uaccess.h
@@ -41,7 +41,7 @@
41 * Test whether a block of memory is a valid user space address. 41 * Test whether a block of memory is a valid user space address.
42 * Returns 0 if the range is valid, nonzero otherwise. 42 * Returns 0 if the range is valid, nonzero otherwise.
43 */ 43 */
44static inline int __chk_range_not_ok(unsigned long addr, unsigned long size, unsigned long limit) 44static inline bool __chk_range_not_ok(unsigned long addr, unsigned long size, unsigned long limit)
45{ 45{
46 /* 46 /*
47 * If we have used "sizeof()" for the size, 47 * If we have used "sizeof()" for the size,
@@ -55,7 +55,9 @@ static inline int __chk_range_not_ok(unsigned long addr, unsigned long size, uns
55 55
56 /* Arbitrary sizes? Be careful about overflow */ 56 /* Arbitrary sizes? Be careful about overflow */
57 addr += size; 57 addr += size;
58 return (addr < size) || (addr > limit); 58 if (addr < size)
59 return true;
60 return addr > limit;
59} 61}
60 62
61#define __range_not_ok(addr, size, limit) \ 63#define __range_not_ok(addr, size, limit) \
@@ -84,7 +86,7 @@ static inline int __chk_range_not_ok(unsigned long addr, unsigned long size, uns
84 * this function, memory access functions may still return -EFAULT. 86 * this function, memory access functions may still return -EFAULT.
85 */ 87 */
86#define access_ok(type, addr, size) \ 88#define access_ok(type, addr, size) \
87 (likely(__range_not_ok(addr, size, user_addr_max()) == 0)) 89 likely(!__range_not_ok(addr, size, user_addr_max()))
88 90
89/* 91/*
90 * The exception table consists of pairs of addresses relative to the 92 * The exception table consists of pairs of addresses relative to the