summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/host1x
diff options
context:
space:
mode:
authorArto Merilainen <amerilainen@nvidia.com>2013-05-29 12:26:06 +0200
committerThierry Reding <thierry.reding@gmail.com>2013-06-22 12:43:54 +0200
commitedeabfcbc150a48e56dd411195ef812134983d6f (patch)
tree0c0d5c24edb5374eb483a6863213e4e59272604a /drivers/gpu/host1x
parentgpu: host1x: Copy gathers before verification (diff)
downloadlinux-edeabfcbc150a48e56dd411195ef812134983d6f.tar.xz
linux-edeabfcbc150a48e56dd411195ef812134983d6f.zip
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,
for (i = 0; i < host->info->nb_pts && sp->name; i++, sp++)
;
- if (sp->dev)
+
+ if (i >= host->info->nb_pts)
return NULL;
name = kasprintf(GFP_KERNEL, "%02d-%s", sp->id,