summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c
diff options
context:
space:
mode:
authorKonsta Holtta <kholtta@nvidia.com>2017-02-23 03:27:51 -0500
committermobile promotions <svcmobile_promotions@nvidia.com>2017-03-16 12:17:22 -0400
commitdd0f3a061b565974727f8790e9552aa20565cbf7 (patch)
tree3107c2aed011f5bbb43c7b5f7f8528eff8c31614 /drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c
parent95ef0315b99e32adbffc23bc8804a0127d3af10a (diff)
gpu: nvgpu: avoid double-free of incr cmd
The call site (gk20a_submit_prepare_syncs) owns the incr_cmd buffer passed to __gk20a_channel_semaphore_incr. Delete the free in the error path of the latter case to avoid freeing the same buffer twice. Bug 1853519 Change-Id: I9b90ce7ebb17ac63992938c7f9fe90bbd139f85f Signed-off-by: Konsta Holtta <kholtta@nvidia.com> Reviewed-on: http://git-master/r/1321117 Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: David Martinez Nieto <dmartineznie@nvidia.com> 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.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c b/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c
index 0aa202c5..b4870c33 100644
--- a/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c
@@ -817,12 +817,10 @@ static int __gk20a_channel_semaphore_incr(
817 dependency, wfi_cmd, 817 dependency, wfi_cmd,
818 need_sync_fence); 818 need_sync_fence);
819 if (err) 819 if (err)
820 goto clean_up_priv_cmd; 820 goto clean_up_sema;
821 821
822 return 0; 822 return 0;
823 823
824clean_up_priv_cmd:
825 gk20a_free_priv_cmdbuf(c, incr_cmd);
826clean_up_sema: 824clean_up_sema:
827 nvgpu_semaphore_put(semaphore); 825 nvgpu_semaphore_put(semaphore);
828 return err; 826 return err;