diff --git a/mm/usercopy.c b/mm/usercopy.c index 8ebae91a6b5519cebf28c623527f6429904820b1..82f81df2edcf91fa0fec44d4d2563d02d7c56b27 100644 --- a/mm/usercopy.c +++ b/mm/usercopy.c @@ -124,7 +124,7 @@ static inline const char *check_kernel_text_object(const void *ptr, static inline const char *check_bogus_address(const void *ptr, unsigned long n) { /* Reject if object wraps past end of memory. */ - if (ptr + n < ptr) + if ((unsigned long)ptr + n < (unsigned long)ptr) return ""; /* Reject if NULL or ZERO-allocation. */