mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-11-27 01:11:31 +00:00
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: Thierry Reding <treding@nvidia.com>
This commit is contained in:
parent
05d2f3ea0d
commit
8cadb01d2c
1 changed files with 1 additions and 1 deletions
|
|
@ -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;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue