aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/infiniband/core/umem.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/infiniband/core/umem.c b/drivers/infiniband/core/umem.c
index 9ac4068d2088..38acb3cfc545 100644
--- a/drivers/infiniband/core/umem.c
+++ b/drivers/infiniband/core/umem.c
@@ -106,8 +106,8 @@ struct ib_umem *ib_umem_get(struct ib_ucontext *context, unsigned long addr,
106 * If the combination of the addr and size requested for this memory 106 * If the combination of the addr and size requested for this memory
107 * region causes an integer overflow, return error. 107 * region causes an integer overflow, return error.
108 */ 108 */
109 if ((PAGE_ALIGN(addr + size) <= size) || 109 if (((addr + size) < addr) ||
110 (PAGE_ALIGN(addr + size) <= addr)) 110 PAGE_ALIGN(addr + size) < (addr + size))
111 return ERR_PTR(-EINVAL); 111 return ERR_PTR(-EINVAL);
112 112
113 if (!can_do_mlock()) 113 if (!can_do_mlock())