[PATCH] drm/msm/atomic: Don't leak atomic commit object when commit fails

Rob Clark robdclark at gmail.com
Sun Feb 22 15:58:34 PST 2015


On Sun, Feb 22, 2015 at 5:58 PM, Laurent Pinchart
<laurent.pinchart+renesas at ideasonboard.com> wrote:
> If the atomic commit fails due to completion wait interruption the
> atomic commit object is not freed and is thus leaked. Free it.
>
> Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas at ideasonboard.com>

thx, queued up on my fixes branch

BR,
-R

> ---
>  drivers/gpu/drm/msm/msm_atomic.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/msm/msm_atomic.c b/drivers/gpu/drm/msm/msm_atomic.c
> index 7c412292a0ff..5b192128cda2 100644
> --- a/drivers/gpu/drm/msm/msm_atomic.c
> +++ b/drivers/gpu/drm/msm/msm_atomic.c
> @@ -219,8 +219,10 @@ int msm_atomic_commit(struct drm_device *dev,
>          * mark our set of crtc's as busy:
>          */
>         ret = start_atomic(dev->dev_private, c->crtc_mask);
> -       if (ret)
> +       if (ret) {
> +               kfree(c);
>                 return ret;
> +       }
>
>         /*
>          * This is the point of no return - everything below never fails except
> --
> Regards,
>
> Laurent Pinchart
>


More information about the dri-devel mailing list