diff options
author | Christian König <christian.koenig@amd.com> | 2020-11-06 15:06:49 +0100 |
---|---|---|
committer | Christian König <christian.koenig@amd.com> | 2020-11-13 17:01:48 +0100 |
commit | e3e043992cb600506022761e9c5c90c85cda3386 (patch) | |
tree | f07561dd63bc416b21b7d13bb423f2f34691a5c9 /drivers | |
parent | drm/udl: Fix missing error code in udl_handle_damage() (diff) | |
download | linux-e3e043992cb600506022761e9c5c90c85cda3386.tar.xz linux-e3e043992cb600506022761e9c5c90c85cda3386.zip |
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')
-rw-r--r-- | drivers/gpu/drm/ttm/ttm_pool.c | 2 |
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; } |