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

Commit 42c31216 authored by Rajesh Kemisetti's avatar Rajesh Kemisetti
Browse files

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: default avatarRajesh Kemisetti <rajeshk@codeaurora.org>
parent 05352690
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;
}