mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-22 17:36:20 +03:00
gpu: nvgpu: Decrement CSS dmabuf ref cnt before ret
The function gk20a_channel_cycle_stats does not decrement the dmabuf refcnt if vmapping it fails. This patch fixes it by decrementing the ref cnt before returning. NVGPU-397 NVGPU-415 Change-Id: Iae01ada710adb04fd4e4ba0371eccec5f8765254 Signed-off-by: Martin Radev <mradev@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2527190 Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com> Reviewed-by: Alex Waterman <alexw@nvidia.com> Reviewed-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com> GVS: Gerrit_Virtual_Submit
This commit is contained in:
committed by
mobile promotions
parent
d2349b32ec
commit
d1983f5cfa
@@ -179,8 +179,10 @@ int gk20a_channel_cycle_stats(struct nvgpu_channel *ch, int dmabuf_fd)
|
|||||||
#else
|
#else
|
||||||
virtual_address = dma_buf_vmap(dmabuf);
|
virtual_address = dma_buf_vmap(dmabuf);
|
||||||
#endif
|
#endif
|
||||||
if (!virtual_address)
|
if (!virtual_address) {
|
||||||
|
dma_buf_put(dmabuf);
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
}
|
||||||
|
|
||||||
priv->cyclestate_buffer_handler = dmabuf;
|
priv->cyclestate_buffer_handler = dmabuf;
|
||||||
ch->cyclestate.cyclestate_buffer = virtual_address;
|
ch->cyclestate.cyclestate_buffer = virtual_address;
|
||||||
|
|||||||
Reference in New Issue
Block a user