提交 8cadb01d 编写于 作者: T Thierry Reding

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: NThierry Reding <treding@nvidia.com>
上级 05d2f3ea
......@@ -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)
{
if (host->info->nb_pts < id)
if (id >= host->info->nb_pts)
return NULL;
return host->syncpt + id;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册