Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3ff10850 authored by Harshdeep Dhatt's avatar Harshdeep Dhatt
Browse files

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: default avatarHarshdeep Dhatt <hdhatt@codeaurora.org>
parent d871aa00
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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 */