diff options
Diffstat (limited to 'drivers/gpu/nvgpu')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c index 291036db..851ae18b 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c | |||
@@ -119,6 +119,16 @@ int gk20a_channel_syncpt_wait_fd(struct gk20a_channel_sync *s, int fd, | |||
119 | if (!sync_fence) | 119 | if (!sync_fence) |
120 | return -EINVAL; | 120 | return -EINVAL; |
121 | 121 | ||
122 | /* validate syncpt ids */ | ||
123 | list_for_each_entry(pt, &sync_fence->pt_list_head, pt_list) { | ||
124 | u32 wait_id = nvhost_sync_pt_id(pt); | ||
125 | if (!wait_id || | ||
126 | wait_id >= nvhost_syncpt_nb_pts_ext(sp->host1x_pdev)) { | ||
127 | sync_fence_put(sync_fence); | ||
128 | return -EINVAL; | ||
129 | } | ||
130 | } | ||
131 | |||
122 | num_wait_cmds = nvhost_sync_num_pts(sync_fence); | 132 | num_wait_cmds = nvhost_sync_num_pts(sync_fence); |
123 | gk20a_channel_alloc_priv_cmdbuf(c, 4 * num_wait_cmds, &wait_cmd); | 133 | gk20a_channel_alloc_priv_cmdbuf(c, 4 * num_wait_cmds, &wait_cmd); |
124 | if (wait_cmd == NULL) { | 134 | if (wait_cmd == NULL) { |