gpu: host1x: Fix syncpt array index check
Mikko Perttunen
maintainerPATCH 1/1 gpu: host1x: Fix syncpt array index check
The index overflow check in host1x_syncpt_get was incorrect, and would return a pointer past the syncpt array if the syncpt index given was the total number of syncpts. Fix this.
Signed-off-by Mikko Perttunen <[email protected]>
--- drivers/gpu/host1x/syncpt.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/host1x/syncpt.c +3 -3
@@ -484,10 +484,10 @@ 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 host->syncpt + id; +else return NULL ; - -return host->syncpt + id; }EXPORT_SYMBOL (host1x_syncpt_get);
Signature · 6 lines
2.11.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel