Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/ttm: fix error handling in ttm_buffer_object_transfer

Unlocking the resv object was missing in the error path, additionally to
that we should move over the resource only after the fence slot was
reserved.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
Fixes: c8d4c18bfbc4a ("dma-buf/drivers: make reserving a shared slot mandatory v4")
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20250616130726.22863-3-christian.koenig@amd.com

+7 -6
+7 -6
drivers/gpu/drm/ttm/ttm_bo_util.c
··· 254 254 ret = dma_resv_trylock(&fbo->base.base._resv); 255 255 WARN_ON(!ret); 256 256 257 + ret = dma_resv_reserve_fences(&fbo->base.base._resv, 1); 258 + if (ret) { 259 + dma_resv_unlock(&fbo->base.base._resv); 260 + kfree(fbo); 261 + return ret; 262 + } 263 + 257 264 if (fbo->base.resource) { 258 265 ttm_resource_set_bo(fbo->base.resource, &fbo->base); 259 266 bo->resource = NULL; 260 267 ttm_bo_set_bulk_move(&fbo->base, NULL); 261 268 } else { 262 269 fbo->base.bulk_move = NULL; 263 - } 264 - 265 - ret = dma_resv_reserve_fences(&fbo->base.base._resv, 1); 266 - if (ret) { 267 - kfree(fbo); 268 - return ret; 269 270 } 270 271 271 272 ttm_bo_get(bo);