[PATCH 2/7] drm/atomic: Early-exit from CRTC dup state
Daniel Stone
daniels at collabora.com
Mon Apr 20 11:22:51 PDT 2015
Just change an if (success) branch to if (fail) return;
Signed-off-by: Daniel Stone <daniels at collabora.com>
---
drivers/gpu/drm/drm_atomic_helper.c | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
index d536817..60eb505 100644
--- a/drivers/gpu/drm/drm_atomic_helper.c
+++ b/drivers/gpu/drm/drm_atomic_helper.c
@@ -1983,12 +1983,13 @@ drm_atomic_helper_crtc_duplicate_state(struct drm_crtc *crtc)
state = kmemdup(crtc->state, sizeof(*crtc->state), GFP_KERNEL);
- if (state) {
- state->mode_changed = false;
- state->active_changed = false;
- state->planes_changed = false;
- state->event = NULL;
- }
+ if (!state)
+ return NULL;
+
+ state->mode_changed = false;
+ state->active_changed = false;
+ state->planes_changed = false;
+ state->event = NULL;
return state;
}
--
2.3.5
More information about the dri-devel
mailing list