From 7072bdc513971528db862f9ab983263b0b48b493 Mon Sep 17 00:00:00 2001 From: Konsta Holtta Date: Fri, 17 Apr 2015 09:32:46 +0300 Subject: 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 Reviewed-on: http://git-master/r/734266 Reviewed-by: Terje Bergstrom Tested-by: Terje Bergstrom --- drivers/gpu/nvgpu/gk20a/channel_gk20a.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'drivers/gpu/nvgpu/gk20a/channel_gk20a.c') 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) if (!completed) break; - c->sync->signal_timeline(c->sync); + if (c->sync) + c->sync->signal_timeline(c->sync); gk20a_vm_put_buffers(vm, job->mapped_buffers, job->num_mapped_buffers); -- cgit v1.2.2