video: tegra: host: add lower bound to num_syncpt_incrs
Gagan Grover [Fri, 21 Oct 2016 10:33:47 +0000 (15:33 +0530)]
Check if there is at least one syncpt_incrs in each job.

Bug 1812182

Change-Id: I0bd0b2e7c4d01641c83ba729ec34390ddea81496
Reviewed-on: http://git-master/r/1221226
Signed-off-by: Gagan Grover <ggrover@nvidia.com>
Reviewed-on: http://git-master/r/1248797
GVS: Gerrit_Virtual_Submit
Reviewed-by: Arto Merilainen <amerilainen@nvidia.com>

drivers/video/tegra/host/bus_client.c

index fb37a9e..267a977 100644 (file)
@@ -399,7 +399,8 @@ static int nvhost_ioctl_channel_submit(struct nvhost_channel_userctx *ctx,
        u32 *local_waitbases = NULL, *local_class_ids = NULL;
        int err, i, hwctx_syncpt_idx = -1;
 
-       if (num_syncpt_incrs > host->info.nb_pts)
+       if ((num_syncpt_incrs < 1) || (num_syncpt_incrs >
+                       host->info.nb_pts))
                return -EINVAL;
 
        if (num_cmdbufs < 0 || num_syncpt_incrs < 0)