diff mbox

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

Message ID 1424645883-14999-1-git-send-email-laurent.pinchart+renesas@ideasonboard.com (mailing list archive)
State Accepted
Headers show

Commit Message

Laurent Pinchart Feb. 22, 2015, 10:58 p.m. UTC
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@ideasonboard.com>
---
 drivers/gpu/drm/msm/msm_atomic.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Rob Clark Feb. 22, 2015, 11:58 p.m. UTC | #1
On Sun, Feb 22, 2015 at 5:58 PM, Laurent Pinchart
<laurent.pinchart+renesas@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@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
>
diff mbox

Patch

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