From: Arto Merilainen <amerilainen@nvidia.com>
To: <thierry.reding@gmail.com>, <airlied@linux.ie>,
<linux-tegra@vger.kernel.org>, <dri-devel@lists.freedesktop.org>
Cc: <tbergstrom@nvidia.com>, <linux-kernel@vger.kernel.org>,
Arto Merilainen <amerilainen@nvidia.com>
Subject: [PATCHv2 5/7] gpu: host1x: Fix memory access in syncpt request
Date: Wed, 29 May 2013 13:26:06 +0300 [thread overview]
Message-ID: <1369823168-5396-6-git-send-email-amerilainen@nvidia.com> (raw)
In-Reply-To: <1369823168-5396-1-git-send-email-amerilainen@nvidia.com>
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>
---
drivers/gpu/host1x/syncpt.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/host1x/syncpt.c b/drivers/gpu/host1x/syncpt.c
index 4b49345..2b03f1b 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,
--
1.8.1.5
next prev parent reply other threads:[~2013-05-29 10:28 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-29 10:26 [PATCHv2 0/7] Miscellaneous fixes to host1x Arto Merilainen
2013-05-29 10:26 ` [PATCHv2 1/7] gpu: host1x: Check INCR opcode correctly Arto Merilainen
2013-05-29 10:26 ` [PATCHv2 2/7] gpu: host1x: Check reloc table before usage Arto Merilainen
2013-05-29 10:26 ` [PATCHv2 3/7] gpu: host1x: Don't reset firewall between gathers Arto Merilainen
2013-05-29 11:21 ` Thierry Reding
2013-05-29 11:29 ` Arto Merilainen
2013-05-29 10:26 ` [PATCHv2 4/7] gpu: host1x: Copy gathers before verification Arto Merilainen
2013-05-29 10:26 ` Arto Merilainen [this message]
2013-05-29 10:26 ` [PATCHv2 6/7] gpu: host1x: Fix client_managed type Arto Merilainen
2013-05-29 10:26 ` [PATCHv2 7/7] gpu: host1x: Rework CPU syncpoint increment Arto Merilainen
2013-05-29 11:24 ` [PATCHv2 0/7] Miscellaneous fixes to host1x Thierry Reding
2013-05-31 7:03 ` Terje Bergström
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1369823168-5396-6-git-send-email-amerilainen@nvidia.com \
--to=amerilainen@nvidia.com \
--cc=airlied@linux.ie \
--cc=dri-devel@lists.freedesktop.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=tbergstrom@nvidia.com \
--cc=thierry.reding@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome