Skip to content
Snippets Groups Projects
Commit 8cadb01d authored by Thierry Reding's avatar Thierry Reding
Browse files

gpu: host1x: Fix potential out-of-bounds access


The check for valid syncpoint IDs is off by one. While at it, rewrite
the check to make it more easily understandable.

Signed-off-by: default avatarThierry Reding <treding@nvidia.com>
parent 05d2f3ea
No related branches found
No related tags found
No related merge requests found
...@@ -484,7 +484,7 @@ unsigned int host1x_syncpt_nb_mlocks(struct host1x *host) ...@@ -484,7 +484,7 @@ unsigned int host1x_syncpt_nb_mlocks(struct host1x *host)
struct host1x_syncpt *host1x_syncpt_get(struct host1x *host, unsigned int id) struct host1x_syncpt *host1x_syncpt_get(struct host1x *host, unsigned int id)
{ {
if (host->info->nb_pts < id) if (id >= host->info->nb_pts)
return NULL; return NULL;
return host->syncpt + id; return host->syncpt + id;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment