summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/gpu/msm/kgsl_iommu.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/msm/kgsl_iommu.c b/drivers/gpu/msm/kgsl_iommu.c
index 1d9bc378affb..a0e84472c8e8 100644
--- a/drivers/gpu/msm/kgsl_iommu.c
+++ b/drivers/gpu/msm/kgsl_iommu.c
@@ -1661,7 +1661,7 @@ static uint64_t _get_unmapped_area_topdown(struct kgsl_pagetable *pagetable,
* the bottom of the previous one
*/
- if (offset < end) {
+ if ((end > size) && (offset < end)) {
uint64_t chunk = (end - size) & mask;
if (chunk >= offset)