aboutsummaryrefslogtreecommitdiffstats
path: root/mm/usercopy.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2016-09-01 12:33:46 -0400
committerThomas Gleixner <tglx@linutronix.de>2016-09-01 12:33:46 -0400
commit0cb7bf61b1e9f05027de58c80f9b46a714d24e35 (patch)
tree41fb55cf62d07b425122f9a8b96412c0d8eb99c5 /mm/usercopy.c
parentaa877175e7a9982233ed8f10cb4bfddd78d82741 (diff)
parent3eab887a55424fc2c27553b7bfe32330df83f7b8 (diff)
Merge branch 'linus' into smp/hotplug
Apply upstream changes to avoid conflicts with pending patches.
Diffstat (limited to 'mm/usercopy.c')
-rw-r--r--mm/usercopy.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/mm/usercopy.c b/mm/usercopy.c
index 8ebae91a6b55..a3cc3052f830 100644
--- a/mm/usercopy.c
+++ b/mm/usercopy.c
@@ -83,7 +83,7 @@ static bool overlaps(const void *ptr, unsigned long n, unsigned long low,
83 unsigned long check_high = check_low + n; 83 unsigned long check_high = check_low + n;
84 84
85 /* Does not overlap if entirely above or entirely below. */ 85 /* Does not overlap if entirely above or entirely below. */
86 if (check_low >= high || check_high < low) 86 if (check_low >= high || check_high <= low)
87 return false; 87 return false;
88 88
89 return true; 89 return true;
@@ -124,7 +124,7 @@ static inline const char *check_kernel_text_object(const void *ptr,
124static inline const char *check_bogus_address(const void *ptr, unsigned long n) 124static inline const char *check_bogus_address(const void *ptr, unsigned long n)
125{ 125{
126 /* Reject if object wraps past end of memory. */ 126 /* Reject if object wraps past end of memory. */
127 if (ptr + n < ptr) 127 if ((unsigned long)ptr + n < (unsigned long)ptr)
128 return "<wrapped address>"; 128 return "<wrapped address>";
129 129
130 /* Reject if NULL or ZERO-allocation. */ 130 /* Reject if NULL or ZERO-allocation. */