summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarshdeep Dhatt <hdhatt@codeaurora.org>2015-12-29 11:09:16 -0700
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-23 21:16:22 -0700
commit1380e19dc8479a960c010a7a489dbe8d5dab1e99 (patch)
treee5140074f0f55db05af72390397614cf8a9b1b23
parent68d94e70f65acb542695ad7f5dc483154a209579 (diff)
msm: kgsl: Purge a memfree entry correctly
For the case when newly allocated gpuaddr falls between a memfree entry's gpuaddr and size, the size of the mem entry was being truncated to a negative value. Fix the math to reflect the truncated size correctly. Change-Id: Id39519acc2af106240db8f41539b9fd1dc0cb0eb Signed-off-by: Harshdeep Dhatt <hdhatt@codeaurora.org>
-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 f0e0008cb520..0d1c75b4b598 100644
--- a/drivers/gpu/msm/kgsl.c
+++ b/drivers/gpu/msm/kgsl.c
@@ -185,7 +185,7 @@ static void kgsl_memfree_purge(pid_t ptname, uint64_t gpuaddr,
if (gpuaddr > entry->gpuaddr &&
gpuaddr < entry->gpuaddr + entry->size) {
/* truncate the end of the entry */
- entry->size = entry->gpuaddr - gpuaddr;
+ entry->size = gpuaddr - entry->gpuaddr;
} else if (gpuaddr <= entry->gpuaddr &&
gpuaddr + size < entry->gpuaddr + entry->size)
/* Truncate the beginning of the entry */