aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSunil Khatri <sunilkh@codeaurora.org>2016-06-15 15:28:22 -0700
committerThierry Strudel <tstrudel@google.com>2016-06-20 20:23:27 +0000
commit6616b1de58a903025f4638f772aedc6e6c99f3c2 (patch)
treef93918ba0664956101b498d6864f3e78ebd5a7b0
parentb2ac504353fa7b4c0b75060093b076716cc90ba3 (diff)
msm: kgsl: Cast perfcounter query count to an unsigned intandroid-6.0.1_r0.103
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. Bug: 27364029 Change-Id: Ic0dedbad825f5b3fd4434f9b9f6d4d308206c0d9 Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org> Signed-off-by: Sunil Khatri <sunilkh@codeaurora.org>
-rw-r--r--drivers/gpu/msm/adreno.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/msm/adreno.c b/drivers/gpu/msm/adreno.c
index 628eeaf847dc..e457be0fa95e 100644
--- a/drivers/gpu/msm/adreno.c
+++ b/drivers/gpu/msm/adreno.c
@@ -536,7 +536,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) {