[PATCH] drm/ttm: fix missing NULL check in the new page pool

Alex Deucher alexdeucher at gmail.com
Mon Nov 9 15:54:24 UTC 2020


On Fri, Nov 6, 2020 at 9:10 AM Christian König
<ckoenig.leichtzumerken at gmail.com> wrote:
>
> The pool parameter can be NULL if we free through the shrinker.
>
> Signed-off-by: Christian König <christian.koenig at amd.com>

Does this fix:
https://gitlab.freedesktop.org/drm/amd/-/issues/1362

Acked-by: Alex Deucher <alexander.deucher at amd.com>



> ---
>  drivers/gpu/drm/ttm/ttm_pool.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> 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;
>         }
> --
> 2.25.1
>
> _______________________________________________
> dri-devel mailing list
> dri-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel


More information about the dri-devel mailing list