From: Arto Merilainen Date: Wed, 29 May 2013 10:26:06 +0000 (+0300) Subject: gpu: host1x: Fix memory access in syncpt request X-Git-Tag: next-20130617~61^2~2 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=61343ef3be6bcc5484307f5dbbf03fd005b2b475;p=karo-tx-linux.git 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 Acked-By: Terje Bergstrom Signed-off-by: Thierry Reding --- 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,