From: Christian König Date: Fri, 17 Dec 2021 15:30:16 +0000 (+0100) Subject: drm/nouveau: audit bo->resource usage X-Git-Tag: v6.1-rc1~159^2~18^2~251 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=64e257f187a5c76ec5766f50204462c0c483e418;p=thirdparty%2Fkernel%2Fstable.git drm/nouveau: audit bo->resource usage Make sure we can at least move and release BOs without backing store. Signed-off-by: Christian König Reviewed-by: Michael J. Ruhl Link: https://patchwork.freedesktop.org/patch/msgid/20220707102453.3633-4-christian.koenig@amd.com --- diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c index 994879d9db74e..35bb0bb3fe61e 100644 --- a/drivers/gpu/drm/nouveau/nouveau_bo.c +++ b/drivers/gpu/drm/nouveau/nouveau_bo.c @@ -1008,7 +1008,8 @@ nouveau_bo_move(struct ttm_buffer_object *bo, bool evict, } /* Fake bo copy. */ - if (old_reg->mem_type == TTM_PL_SYSTEM && !bo->ttm) { + if (!old_reg || (old_reg->mem_type == TTM_PL_SYSTEM && + !bo->ttm)) { ttm_bo_move_null(bo, new_reg); goto out; }