video: tegra: host: add lower bound to num_syncpt_incrs
Gagan Grover [Fri, 21 Oct 2016 06:15:00 +0000 (11:15 +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/1240374
Reviewed-by: Arto Merilainen <amerilainen@nvidia.com>
(cherry picked from commit 847bb69132adcdb8fc2ce2d7dabeb80d9cc2aa32)
Reviewed-on: http://git-master/r/1460494
GVS: Gerrit_Virtual_Submit
Tested-by: Sandipan Patra <spatra@nvidia.com>
Reviewed-by: Winnie Hsu <whsu@nvidia.com>

drivers/video/tegra/host/bus_client.c

index 04718ef..f544e5b 100644 (file)
@@ -538,7 +538,7 @@ static int nvhost_ioctl_channel_submit(struct nvhost_channel_userctx *ctx,
        if (num_cmdbufs < 0)
                return -EINVAL;
 
-       if ((num_syncpt_incrs < 0) || (num_syncpt_incrs >
+       if ((num_syncpt_incrs < 1) || (num_syncpt_incrs >
                     nvhost_syncpt_nb_pts(&nvhost_get_host(ctx->pdev)->syncpt)))
                return -EINVAL;