Commit 39a3d570 authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Laurent Pinchart

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: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
parent 898a2f38
...@@ -495,8 +495,10 @@ static int rcar_du_atomic_commit(struct drm_device *dev, ...@@ -495,8 +495,10 @@ static int rcar_du_atomic_commit(struct drm_device *dev,
/* Allocate the commit object. */ /* Allocate the commit object. */
commit = kzalloc(sizeof(*commit), GFP_KERNEL); commit = kzalloc(sizeof(*commit), GFP_KERNEL);
if (commit == NULL) if (commit == NULL) {
return -ENOMEM; ret = -ENOMEM;
goto error;
}
INIT_WORK(&commit->work, rcar_du_atomic_work); INIT_WORK(&commit->work, rcar_du_atomic_work);
commit->dev = dev; commit->dev = dev;
...@@ -519,7 +521,7 @@ static int rcar_du_atomic_commit(struct drm_device *dev, ...@@ -519,7 +521,7 @@ static int rcar_du_atomic_commit(struct drm_device *dev,
if (ret) { if (ret) {
kfree(commit); kfree(commit);
return ret; goto error;
} }
/* Swap the state, this is the point of no return. */ /* Swap the state, this is the point of no return. */
...@@ -531,6 +533,10 @@ static int rcar_du_atomic_commit(struct drm_device *dev, ...@@ -531,6 +533,10 @@ static int rcar_du_atomic_commit(struct drm_device *dev,
rcar_du_atomic_complete(commit); rcar_du_atomic_complete(commit);
return 0; return 0;
error:
drm_atomic_helper_cleanup_planes(dev, state);
return ret;
} }
/* ----------------------------------------------------------------------------- /* -----------------------------------------------------------------------------
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment