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>
return ret;
c = commit_init(state);
- if (!c)
- return -ENOMEM;
+ if (!c) {
+ ret = -ENOMEM;
+ goto error;
+ }
/*
* Figure out what crtcs we have:
ret = start_atomic(dev->dev_private, c->crtc_mask);
if (ret) {
kfree(c);
- return ret;
+ goto error;
}
/*
complete_commit(c);
return 0;
+
+error:
+ drm_atomic_helper_cleanup_planes(dev, state);
+ return ret;
}