[PATCH 1/4] drm/radeon: add extra check in radeon_ttm_tt_unpin_userptr

Alex Deucher alexdeucher at gmail.com
Tue Mar 31 09:13:51 PDT 2015


On Tue, Mar 31, 2015 at 11:36 AM, Christian König
<deathsimple at vodafone.de> wrote:
> From: Christian König <christian.koenig at amd.com>
>
> We somehow try to free the SG table twice.
>
> Bugs: https://bugs.freedesktop.org/show_bug.cgi?id=89734
>
> Signed-off-by: Christian König <christian.koenig at amd.com>
> Cc: <stable at vger.kernel.org>

For the series:
Reviewed-by: Alex Deucher <alexander.deucher at amd.com>

I've added the first two to my -fixes tree.

Alex

> ---
>  drivers/gpu/drm/radeon/radeon_ttm.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_ttm.c b/drivers/gpu/drm/radeon/radeon_ttm.c
> index d02aa1d..b292aca 100644
> --- a/drivers/gpu/drm/radeon/radeon_ttm.c
> +++ b/drivers/gpu/drm/radeon/radeon_ttm.c
> @@ -598,6 +598,10 @@ static void radeon_ttm_tt_unpin_userptr(struct ttm_tt *ttm)
>         enum dma_data_direction direction = write ?
>                 DMA_BIDIRECTIONAL : DMA_TO_DEVICE;
>
> +       /* double check that we don't free the table twice */
> +       if (!ttm->sg->sgl)
> +               return;
> +
>         /* free the sg table and pages again */
>         dma_unmap_sg(rdev->dev, ttm->sg->sgl, ttm->sg->nents, direction);
>
> --
> 1.9.1
>


More information about the dri-devel mailing list