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>
This commit is contained in:
Konsta Holtta
2017-02-23 10:27:51 +02:00
committed by mobile promotions
parent 95ef0315b9
commit dd0f3a061b

View File

@@ -817,12 +817,10 @@ static int __gk20a_channel_semaphore_incr(
dependency, wfi_cmd, dependency, wfi_cmd,
need_sync_fence); need_sync_fence);
if (err) if (err)
goto clean_up_priv_cmd; goto clean_up_sema;
return 0; return 0;
clean_up_priv_cmd:
gk20a_free_priv_cmdbuf(c, incr_cmd);
clean_up_sema: clean_up_sema:
nvgpu_semaphore_put(semaphore); nvgpu_semaphore_put(semaphore);
return err; return err;