From d2b1f886bab242b4239fa98228a716195a62934f Mon Sep 17 00:00:00 2001 From: jsg Date: Sun, 13 Aug 2023 10:20:31 +0000 Subject: [PATCH] drm/ttm: check null pointer before accessing when swapping From Guchun Chen 1fdd16d89c01336d9a942b5f03673c17d401da87 in linux-6.1.y/6.1.45 2dedcf414bb01b8d966eb445db1d181d92304fb2 in mainline linux --- sys/dev/pci/drm/ttm/ttm_bo.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/dev/pci/drm/ttm/ttm_bo.c b/sys/dev/pci/drm/ttm/ttm_bo.c index 7959f645a75..b0ebb066ce3 100644 --- a/sys/dev/pci/drm/ttm/ttm_bo.c +++ b/sys/dev/pci/drm/ttm/ttm_bo.c @@ -552,7 +552,8 @@ static bool ttm_bo_evict_swapout_allowable(struct ttm_buffer_object *bo, if (bo->pin_count) { *locked = false; - *busy = false; + if (busy) + *busy = false; return false; } -- 2.20.1