drm/ttm: check null pointer before accessing when swapping
authorjsg <jsg@openbsd.org>
Sun, 13 Aug 2023 10:20:31 +0000 (10:20 +0000)
committerjsg <jsg@openbsd.org>
Sun, 13 Aug 2023 10:20:31 +0000 (10:20 +0000)
From Guchun Chen
1fdd16d89c01336d9a942b5f03673c17d401da87 in linux-6.1.y/6.1.45
2dedcf414bb01b8d966eb445db1d181d92304fb2 in mainline linux

sys/dev/pci/drm/ttm/ttm_bo.c

index 7959f64..b0ebb06 100644 (file)
@@ -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;
        }