Browse Source

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

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>
Signed-off-by: Rob Clark <robdclark@gmail.com>
Laurent Pinchart 10 years ago
parent
commit
5b2e2b6c5e
1 changed files with 3 additions and 1 deletions
  1. 3 1
      drivers/gpu/drm/msm/msm_atomic.c

+ 3 - 1
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:
 	 * mark our set of crtc's as busy:
 	 */
 	 */
 	ret = start_atomic(dev->dev_private, c->crtc_mask);
 	ret = start_atomic(dev->dev_private, c->crtc_mask);
-	if (ret)
+	if (ret) {
+		kfree(c);
 		return ret;
 		return ret;
+	}
 
 
 	/*
 	/*
 	 * This is the point of no return - everything below never fails except
 	 * This is the point of no return - everything below never fails except