From dd0f3a061b565974727f8790e9552aa20565cbf7 Mon Sep 17 00:00:00 2001 From: Konsta Holtta Date: Thu, 23 Feb 2017 10:27:51 +0200 Subject: 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 Reviewed-on: http://git-master/r/1321117 Reviewed-by: svccoveritychecker GVS: Gerrit_Virtual_Submit Reviewed-by: David Martinez Nieto Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/gk20a/channel_sync_gk20a.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'drivers/gpu/nvgpu') 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( dependency, wfi_cmd, need_sync_fence); if (err) - goto clean_up_priv_cmd; + goto clean_up_sema; return 0; -clean_up_priv_cmd: - gk20a_free_priv_cmdbuf(c, incr_cmd); clean_up_sema: nvgpu_semaphore_put(semaphore); return err; -- cgit v1.2.2