aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.c
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2021-06-24 12:47:32 -0500
committerChristian König <[email protected]>2021-07-12 13:34:49 +0200
commitffe000217c5068c5da07ccb1c0f8cce7ad767435 (patch)
treedb4fdd7ea3cb5c22f6107a66b619c6c725990d2e /drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.c
parent1988e0d84161dabd99d1c27033fbd6ee439bf432 (diff)
dma-buf/sync_file: Don't leak fences on merge failure
Each add_fence() call does a dma_fence_get() on the relevant fence. In the error path, we weren't calling dma_fence_put() so all those fences got leaked. Also, in the krealloc_array failure case, we weren't freeing the fences array. Instead, ensure that i and fences are always zero-initialized and dma_fence_put() all the fences and kfree(fences) on every error path. Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Christian König <[email protected]> Fixes: a02b9dc90d84 ("dma-buf/sync_file: refactor fence storage in struct sync_file") Cc: Gustavo Padovan <[email protected]> Cc: Christian König <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Christian König <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_jpeg.c')
0 files changed, 0 insertions, 0 deletions