gpu: nvgpu: remove unbalanced dma_fence reference

job->post_fence dma_fence is created for a syncpoint by nvgpu during
submission. This fence is not freed after job completion as extra
dma_fence reference (dma_fence_get) is taken in
nvgpu_nvhost_fence_install.

sync_file_create called from this function already takes one ref
which will be dropped when the sync file is closed. dma_fence_get
called here from nvgpu_nvhost_fence_install is not paired with
corresponding put.

Remove this dma_fence_get call to fix the dma_fence memleak.

Bug 4788227

Change-Id: I003756dc9e023751b28161d322740309e08dedb5
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/3199426
(cherry picked from commit a6818ea83516c8bd8961f03ad78421366d269572)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/3211402
Tested-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
Sagar Kamble
2024-08-23 18:31:30 +00:00
committed by mobile promotions
parent e2d19ad097
commit 32b5ab51a6

View File

@@ -359,7 +359,6 @@ int nvgpu_nvhost_fence_install(struct nvhost_fence *fence, int fd)
if (!file) if (!file)
return -ENOMEM; return -ENOMEM;
dma_fence_get(f);
fd_install(fd, file->file); fd_install(fd, file->file);
return 0; return 0;