aboutsummaryrefslogtreecommitdiffstats
path: root/mm/usercopy.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/usercopy.c')
-rw-r--r--mm/usercopy.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/usercopy.c b/mm/usercopy.c
index 2a09796edef8..98e924864554 100644
--- a/mm/usercopy.c
+++ b/mm/usercopy.c
@@ -147,7 +147,7 @@ static inline void check_bogus_address(const unsigned long ptr, unsigned long n,
147 bool to_user) 147 bool to_user)
148{ 148{
149 /* Reject if object wraps past end of memory. */ 149 /* Reject if object wraps past end of memory. */
150 if (ptr + n < ptr) 150 if (ptr + (n - 1) < ptr)
151 usercopy_abort("wrapped address", NULL, to_user, 0, ptr + n); 151 usercopy_abort("wrapped address", NULL, to_user, 0, ptr + n);
152 152
153 /* Reject if NULL or ZERO-allocation. */ 153 /* Reject if NULL or ZERO-allocation. */