summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/rcar-du
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2015-05-27 02:14:37 +0300
committerLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>2015-06-16 14:25:54 +0300
commit39a3d5706527615db2b7d121b64445e79ca1cc1f (patch)
treea98280067809750a367b26b2c6f1c1ea35b9f7b6 /drivers/gpu/drm/rcar-du
parent898a2f387d1c663772c630e8f78ef60f1639077e (diff)
downloadlinux-39a3d5706527615db2b7d121b64445e79ca1cc1f.tar.bz2
drm: rcar-du: Clean up planes in the error paths of .atomic_commit()
When the .atomic_commit() handler fails, clean up planes previoulsy prepared by drm_atomic_helper_prepare_planes() with a call to drm_atomic_helper_cleanup_planes(). Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'drivers/gpu/drm/rcar-du')
-rw-r--r--drivers/gpu/drm/rcar-du/rcar_du_kms.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/gpu/drm/rcar-du/rcar_du_kms.c b/drivers/gpu/drm/rcar-du/rcar_du_kms.c
index fa185a450aea..56518eb1269a 100644
--- a/drivers/gpu/drm/rcar-du/rcar_du_kms.c
+++ b/drivers/gpu/drm/rcar-du/rcar_du_kms.c
@@ -495,8 +495,10 @@ static int rcar_du_atomic_commit(struct drm_device *dev,
/* Allocate the commit object. */
commit = kzalloc(sizeof(*commit), GFP_KERNEL);
- if (commit == NULL)
- return -ENOMEM;
+ if (commit == NULL) {
+ ret = -ENOMEM;
+ goto error;
+ }
INIT_WORK(&commit->work, rcar_du_atomic_work);
commit->dev = dev;
@@ -519,7 +521,7 @@ static int rcar_du_atomic_commit(struct drm_device *dev,
if (ret) {
kfree(commit);
- return ret;
+ goto error;
}
/* Swap the state, this is the point of no return. */
@@ -531,6 +533,10 @@ static int rcar_du_atomic_commit(struct drm_device *dev,
rcar_du_atomic_complete(commit);
return 0;
+
+error:
+ drm_atomic_helper_cleanup_planes(dev, state);
+ return ret;
}
/* -----------------------------------------------------------------------------