From: Laurent Pinchart Date: Sun, 22 Feb 2015 22:58:03 +0000 (+0200) Subject: drm/msm/atomic: Don't leak atomic commit object when commit fails X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=5b2e2b6c5e542f7334dcaeb5b577d8328a5f2fc0;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: Rob Clark --- diff --git a/drivers/gpu/drm/msm/msm_atomic.c b/drivers/gpu/drm/msm/msm_atomic.c index 871aa2108dc6..18fd643b6e69 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