From 90fc8d653fba60a6f7b96e7d91ff02361a3a4890 Mon Sep 17 00:00:00 2001 From: Konsta Holtta Date: Thu, 21 Jun 2018 13:01:14 +0300 Subject: gpu: nvgpu: only free wait_cmd if it exists gk20a_submit_prepare_syncs can fall to error handling paths without an allocated wait command buffer. In that case, just don't try to free the null wait_cmd; the user never requested one. Change-Id: Ice9041c0efa9bb14cde917e7ea82f4a7b6bf537c Signed-off-by: Konsta Holtta Reviewed-on: https://git-master.nvidia.com/r/1756829 Reviewed-by: svc-mobile-coverity Reviewed-by: Deepak Nibade Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Sami Kiminki GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/os/linux/channel.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/gpu/nvgpu/os/linux/channel.c b/drivers/gpu/nvgpu/os/linux/channel.c index 37e36cb9..391950af 100644 --- a/drivers/gpu/nvgpu/os/linux/channel.c +++ b/drivers/gpu/nvgpu/os/linux/channel.c @@ -630,7 +630,8 @@ clean_up_post_fence: gk20a_fence_put(job->post_fence); job->post_fence = NULL; clean_up_wait_cmd: - free_priv_cmdbuf(c, job->wait_cmd); + if (job->wait_cmd) + free_priv_cmdbuf(c, job->wait_cmd); if (!pre_alloc_enabled) job->wait_cmd = NULL; fail: -- cgit v1.2.2