summaryrefslogtreecommitdiff
path: root/drivers/gpu/msm
diff options
context:
space:
mode:
authorRajesh Kemisetti <rajeshk@codeaurora.org>2015-12-28 11:19:41 +0530
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-23 21:16:16 -0700
commit52939ea591795252c735ab9a42e023a21c81cba9 (patch)
treec62c7ea0a6d369e9a2069b9fa7524a689732e5e9 /drivers/gpu/msm
parent7dc9344963b2d81f692dd0a704fe30d5eeffdcff (diff)
msm: kgsl: BUG_ON only if address is not an error
_gpu_find_svm() makes a BUG_ON if the returned address is greater than ULONG_MAX. But in 32bit kernel, Error conditions would also make the comparison to be true. Because it compares address or error in unit64_t with ULONG_MAX which is in 32bit. Check whether returned address is an error before making the BUG_ON. Change-Id: I482b330db3e06a1bee31dd6931faf239a61f9ab8 Signed-off-by: Rajesh Kemisetti <rajeshk@codeaurora.org>
Diffstat (limited to 'drivers/gpu/msm')
-rw-r--r--drivers/gpu/msm/kgsl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/msm/kgsl.c b/drivers/gpu/msm/kgsl.c
index d5e96abdb8d5..f0e0008cb520 100644
--- a/drivers/gpu/msm/kgsl.c
+++ b/drivers/gpu/msm/kgsl.c
@@ -3410,7 +3410,7 @@ static unsigned long _gpu_find_svm(struct kgsl_process_private *private,
uint64_t addr = kgsl_mmu_find_svm_region(private->pagetable,
(uint64_t) start, (uint64_t)end, (uint64_t) len, align);
- BUG_ON(addr > ULONG_MAX);
+ BUG_ON(!IS_ERR_VALUE((unsigned long)addr) && (addr > ULONG_MAX));
return (unsigned long) addr;
}