summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/ttm/ttm_pool.c
diff options
context:
space:
mode:
authorChristian König <christian.koenig@amd.com>2020-11-06 15:06:49 +0100
committerChristian König <christian.koenig@amd.com>2020-11-13 17:01:48 +0100
commite3e043992cb600506022761e9c5c90c85cda3386 (patch)
treef07561dd63bc416b21b7d13bb423f2f34691a5c9 /drivers/gpu/drm/ttm/ttm_pool.c
parenta7319c8f50c5e93a12997e2d0821a2f7946fb734 (diff)
downloadlinux-e3e043992cb600506022761e9c5c90c85cda3386.tar.bz2
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 <christian.koenig@amd.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Tested-by: Martin Peres <martin.peres@mupuf.org> Acked-by: Martin Peres <martin.peres@mupuf.org> Reported-by: Andy Lavr <andy.lavr@gmail.com> Tested-by: Andy Lavr <andy.lavr@gmail.com> Link: https://patchwork.freedesktop.org/patch/399365/
Diffstat (limited to 'drivers/gpu/drm/ttm/ttm_pool.c')
-rw-r--r--drivers/gpu/drm/ttm/ttm_pool.c2
1 files changed, 1 insertions, 1 deletions
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;
}