Skip to content

Commit

Permalink
drm/msm/atomic: Clean up planes in the error paths of .atomic_commit()
Browse files Browse the repository at this point in the history
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>
Signed-off-by: Rob Clark <robdclark@gmail.com>
  • Loading branch information
Laurent Pinchart authored and Rob Clark committed Jun 11, 2015
1 parent 1efb92a commit f65c18c
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions drivers/gpu/drm/msm/msm_atomic.c
Original file line number Diff line number Diff line change
@@ -213,8 +213,10 @@ int msm_atomic_commit(struct drm_device *dev,
return ret;

c = commit_init(state);
if (!c)
return -ENOMEM;
if (!c) {
ret = -ENOMEM;
goto error;
}

/*
* Figure out what crtcs we have:
@@ -247,7 +249,7 @@ int msm_atomic_commit(struct drm_device *dev,
ret = start_atomic(dev->dev_private, c->crtc_mask);
if (ret) {
kfree(c);
return ret;
goto error;
}

/*
@@ -291,4 +293,8 @@ int msm_atomic_commit(struct drm_device *dev,
complete_commit(c);

return 0;

error:
drm_atomic_helper_cleanup_planes(dev, state);
return ret;
}

0 comments on commit f65c18c

Please sign in to comment.