drm/ttm: check null pointer before accessing when swapping
Subsystems (3)
PATCH 1/1 drm/ttm: check null pointer before accessing when swapping
Add a check to avoid null pointer dereference.
Fixes a2848d08742c ("drm/ttm: never consider pinned BOs for eviction&swap")
Signed-off-by Guchun Chen <[email protected]>
--- drivers/gpu/drm/ttm/ttm_bo.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/ttm/ttm_bo.c +2 -1
@@ -519,7 +519,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; }
Signature · 1 line
2.25.1