diff options
author | Konsta Holtta <kholtta@nvidia.com> | 2015-04-17 02:32:46 -0400 |
---|---|---|
committer | Ishan Mittal <imittal@nvidia.com> | 2015-05-18 02:01:39 -0400 |
commit | 7072bdc513971528db862f9ab983263b0b48b493 (patch) | |
tree | 4983076d9668164ed769984fba1115a45c865b05 | |
parent | ae2a356f367eb399519d194a33aba6e0f83834a4 (diff) |
gpu: nvgpu: check sync existence in channel update
The channel sync object can get deleted before all channel updates have
finished if the channel is freed before them, so work around a null
dereference by testing if the sync exists. Channel and/or c->sync
refcounting would be necessary for proper fix.
Bug 200076344
Change-Id: Ica8ef2df9cd95cfa593cd4f41768dbb6641357b2
Signed-off-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-on: http://git-master/r/734266
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/channel_gk20a.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c index 444a1c2f..5691a7cd 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c | |||
@@ -1331,7 +1331,8 @@ void gk20a_channel_update(struct channel_gk20a *c, int nr_completed) | |||
1331 | if (!completed) | 1331 | if (!completed) |
1332 | break; | 1332 | break; |
1333 | 1333 | ||
1334 | c->sync->signal_timeline(c->sync); | 1334 | if (c->sync) |
1335 | c->sync->signal_timeline(c->sync); | ||
1335 | 1336 | ||
1336 | gk20a_vm_put_buffers(vm, job->mapped_buffers, | 1337 | gk20a_vm_put_buffers(vm, job->mapped_buffers, |
1337 | job->num_mapped_buffers); | 1338 | job->num_mapped_buffers); |