summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/channel_gk20a.c
diff options
context:
space:
mode:
authorSachit Kadle <skadle@nvidia.com>2016-11-17 15:57:56 -0500
committermobile promotions <svcmobile_promotions@nvidia.com>2016-11-21 07:00:13 -0500
commit5277ecd79cb2ff9bbad3cc2a755a727c2a9e90f0 (patch)
treec885fd9cd831dfdbd57da6d94aff0b4be5897efb /drivers/gpu/nvgpu/gk20a/channel_gk20a.c
parentc1064c27dfa26847234153652cf2b88167b90adf (diff)
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 <skadle@nvidia.com> Reviewed-on: http://git-master/r/1255858 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Seshendra Gadagottu <sgadagottu@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/channel_gk20a.c')
-rw-r--r--drivers/gpu/nvgpu/gk20a/channel_gk20a.c6
1 files changed, 4 insertions, 2 deletions
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:
1809 if (args->num_inflight_jobs) 1809 if (args->num_inflight_jobs)
1810 channel_gk20a_free_prealloc_resources(c); 1810 channel_gk20a_free_prealloc_resources(c);
1811clean_up_sync: 1811clean_up_sync:
1812 gk20a_channel_sync_destroy(c->sync); 1812 if (c->sync) {
1813 c->sync = NULL; 1813 gk20a_channel_sync_destroy(c->sync);
1814 c->sync = NULL;
1815 }
1814clean_up_unmap: 1816clean_up_unmap:
1815 nvgpu_free(c->gpfifo.pipe); 1817 nvgpu_free(c->gpfifo.pipe);
1816 gk20a_gmmu_unmap_free(ch_vm, &c->gpfifo.mem); 1818 gk20a_gmmu_unmap_free(ch_vm, &c->gpfifo.mem);