From 5277ecd79cb2ff9bbad3cc2a755a727c2a9e90f0 Mon Sep 17 00:00:00 2001 From: Sachit Kadle Date: Thu, 17 Nov 2016 12:57:56 -0800 Subject: gpu: nvgpu: fix error handling bug This change fixes error handling logic in gk20a_alloc_channel_gpfifo(). In cases, where we don't allocate a channel_sync at gpfifo allocation time, we shouldn't attempt to destroy it while handling an error. Bug 200253447 Change-Id: I57a78c74bbce84fa17fb0360c59b8f413a9124a7 Signed-off-by: Sachit Kadle Reviewed-on: http://git-master/r/1255858 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Seshendra Gadagottu GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/gk20a/channel_gk20a.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (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 8105de11..6207ab23 100644 --- a/drivers/gpu/nvgpu/gk20a/channel_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/channel_gk20a.c @@ -1809,8 +1809,10 @@ clean_up_prealloc: if (args->num_inflight_jobs) channel_gk20a_free_prealloc_resources(c); clean_up_sync: - gk20a_channel_sync_destroy(c->sync); - c->sync = NULL; + if (c->sync) { + gk20a_channel_sync_destroy(c->sync); + c->sync = NULL; + } clean_up_unmap: nvgpu_free(c->gpfifo.pipe); gk20a_gmmu_unmap_free(ch_vm, &c->gpfifo.mem); -- cgit v1.2.2