]> git.baikalelectronics.ru Git - kernel.git/commit
drm/ttm: fix dma_fence refcount imbalance on error path
authorLin Yi <teroincn@163.com>
Wed, 10 Apr 2019 02:23:34 +0000 (10:23 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 11 Apr 2019 15:02:21 +0000 (10:02 -0500)
commit80fa0d86e8f7ed0c9f70ddd4456cde53b2da8a2e
tree383cf020fe70cecdfad507fd796c280ff5c4ea92
parentef8a567c91bf5105542f82fcb5d87d42ffb10f79
drm/ttm: fix dma_fence refcount imbalance on error path

the ttm_bo_add_move_fence takes a reference to the struct dma_fence, but
failed to release it on the error path, leading to a memory leak.
add dma_fence_put before return when error occur.

Signed-off-by: Lin Yi <teroincn@163.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/ttm/ttm_bo.c