From: Christian König Date: Fri, 6 Nov 2020 14:06:49 +0000 (+0100) Subject: drm/ttm: fix missing NULL check in the new page pool X-Git-Tag: Ubuntu-5.11.0-11.12~930^2~6^2~74 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=e3e043992cb600506022761e9c5c90c85cda3386;p=mirror_ubuntu-hirsute-kernel.git drm/ttm: fix missing NULL check in the new page pool The pool parameter can be NULL if we free through the shrinker. Signed-off-by: Christian König Acked-by: Alex Deucher Tested-by: Martin Peres Acked-by: Martin Peres Reported-by: Andy Lavr Tested-by: Andy Lavr Link: https://patchwork.freedesktop.org/patch/399365/ --- diff --git a/drivers/gpu/drm/ttm/ttm_pool.c b/drivers/gpu/drm/ttm/ttm_pool.c index 44ec41aa78d6..1b96780b4989 100644 --- a/drivers/gpu/drm/ttm/ttm_pool.c +++ b/drivers/gpu/drm/ttm/ttm_pool.c @@ -135,7 +135,7 @@ static void ttm_pool_free_page(struct ttm_pool *pool, enum ttm_caching caching, set_pages_wb(p, 1 << order); #endif - if (!pool->use_dma_alloc) { + if (!pool || !pool->use_dma_alloc) { __free_pages(p, order); return; }