aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/host1x
diff options
context:
space:
mode:
authorArto Merilainen <amerilainen@nvidia.com>2013-05-29 06:26:06 -0400
committerThierry Reding <thierry.reding@gmail.com>2013-06-22 06:43:54 -0400
commitedeabfcbc150a48e56dd411195ef812134983d6f (patch)
tree0c0d5c24edb5374eb483a6863213e4e59272604a /drivers/gpu/host1x
parent3364cd28906d87f0c77754998679bb66639d4112 (diff)
gpu: host1x: Fix memory access in syncpt request
This patch fixes a bad memory access in syncpoint request code. If no syncpoints were available, the code accessed unreserved memory area causing unexpected behaviour. Signed-off-by: Arto Merilainen <amerilainen@nvidia.com> Acked-By: Terje Bergstrom <tbergstrom@nvidia.com> Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
Diffstat (limited to 'drivers/gpu/host1x')
-rw-r--r--drivers/gpu/host1x/syncpt.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/host1x/syncpt.c b/drivers/gpu/host1x/syncpt.c
index 4b493453e805..2b03f1b5cc5a 100644
--- a/drivers/gpu/host1x/syncpt.c
+++ b/drivers/gpu/host1x/syncpt.c
@@ -40,7 +40,8 @@ static struct host1x_syncpt *_host1x_syncpt_alloc(struct host1x *host,
40 40
41 for (i = 0; i < host->info->nb_pts && sp->name; i++, sp++) 41 for (i = 0; i < host->info->nb_pts && sp->name; i++, sp++)
42 ; 42 ;
43 if (sp->dev) 43
44 if (i >= host->info->nb_pts)
44 return NULL; 45 return NULL;
45 46
46 name = kasprintf(GFP_KERNEL, "%02d-%s", sp->id, 47 name = kasprintf(GFP_KERNEL, "%02d-%s", sp->id,