[PATCH xf86-video-amdgpu 5/5] Free priv in amdgpu_set_pixmap_bo also if priv->bo == NULL

Alex Deucher alexdeucher at gmail.com
Wed Jun 15 15:52:13 UTC 2016


On Wed, Jun 15, 2016 at 6:00 AM, Michel Dänzer <michel at daenzer.net> wrote:
> From: Michel Dänzer <michel.daenzer at amd.com>
>
> Fixes memory leak when destroying pixmaps with priv->bo == NULL.
>
> Reported-by: Qiang Yu <qiang.yu at amd.com>
> Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>

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

> ---
>  src/amdgpu_pixmap.h | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/src/amdgpu_pixmap.h b/src/amdgpu_pixmap.h
> index 9c51067..a8de26a 100644
> --- a/src/amdgpu_pixmap.h
> +++ b/src/amdgpu_pixmap.h
> @@ -63,10 +63,10 @@ static inline Bool amdgpu_set_pixmap_bo(PixmapPtr pPix, struct amdgpu_buffer *bo
>                 return TRUE;
>
>         if (priv) {
> -               if (priv->bo == bo)
> -                       return TRUE;
> -
>                 if (priv->bo) {
> +                       if (priv->bo == bo)
> +                               return TRUE;
> +
>                         amdgpu_bo_unref(&priv->bo);
>                         priv->handle_valid = FALSE;
>                 }
> --
> 2.8.1
>
> _______________________________________________
> xorg-driver-ati mailing list
> xorg-driver-ati at lists.x.org
> https://lists.x.org/mailman/listinfo/xorg-driver-ati


More information about the xorg-driver-ati mailing list