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

Commit e84bb416 authored by Jordan Crouse's avatar Jordan Crouse Committed by Jeremy Gebben
Browse files

msm: kgsl: Cast perfcounter query count to an unsigned int



In adreno_perfcounter_query_group() make sure to cast the user passed
count to an unsigned int before comparing it to the group count.
Otherwise the user count could be interpeted as a signed int and
hilarity ensues.

Change-Id: Ic0dedbad825f5b3fd4434f9b9f6d4d308206c0d9
Signed-off-by: default avatarJordan Crouse <jcrouse@codeaurora.org>
parent f5c411d2
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -408,7 +408,7 @@ int adreno_perfcounter_query_group(struct adreno_device *adreno_dev,
		return 0;
	}

	t = min_t(int, group->reg_count, count);
	t = min_t(unsigned int, group->reg_count, count);

	buf = kmalloc(t * sizeof(unsigned int), GFP_KERNEL);
	if (buf == NULL) {