summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c
diff options
context:
space:
mode:
authorDeepak Nibade <dnibade@nvidia.com>2014-04-01 02:44:50 -0400
committerDan Willemsen <dwillemsen@nvidia.com>2015-03-18 15:09:00 -0400
commitf5fe93456f6e47cf0fea0f4c5af8f797e51498c0 (patch)
treef726d85b85d4a62dc358e43957f4a1e6a1fc862d /drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c
parent65c230fc83325828e152a4479d7ffefbbe784a77 (diff)
gpu: nvgpu: gk20a: add syncpt id checks
add valid syncpt id checks when syncpt id is extracted from fence fd Bug 1448825 Change-Id: I0f1722aad60e7644b8f490f24cf18a3b80f8583c Signed-off-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-on: http://git-master/r/390572 Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c10
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) {