Skip to contentSkip to conversation

drm/atomic: fix an error code in mode_fixup()

PATCH Applied Dan Carpenter 2 participants 2 messages Feb 7, 2017 – Feb 8, 2017

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/atomic: fix an error code in mode_fixup()

Having "ret" be a bool type works for everything except ret = funcs->atomic_check(). The other functions all return zero on error but ->atomic_check() returns negative error codes. We want to propagate the error code but instead we return 1.

I found this bug with static analysis and I don't know if it affects run time.

Fixes 4cd4df8080a3 ("drm/atomic: Add ->atomic_check() to encoder helpers")
drivers/gpu/drm/drm_atomic_helper.c +1 -1
index 9a08445a7a7a..01d936b7be43 100644
@@ -369,7 +369,7 @@ mode_fixup(struct drm_atomic_state *state)
 	struct drm_connector *connector;
 	struct drm_connector_state *conn_state;
 	int i;
-	bool ret;
+	int ret;
 
 	for_each_crtc_in_state(state, crtc, crtc_state, i) {
 		if (!crtc_state->mode_changed &&
#1 lore raw
Quoted 10 lines · Dan Carpenter

Having "ret" be a bool type works for everything except ret = funcs->atomic_check(). The other functions all return zero on error but ->atomic_check() returns negative error codes. We want to propagate the error code but instead we return 1.

I found this bug with static analysis and I don't know if it affects run time.

Fixes 4cd4df8080a3 ("drm/atomic: Add ->atomic_check() to encoder helpers")

Applied to drm-misc for 4.11, thanks.
-Daniel

Quoted 18 lines
drivers/gpu/drm/drm_atomic_helper.c +1 -1
index 9a08445a7a7a..01d936b7be43 100644
@@ -369,7 +369,7 @@ mode_fixup(struct drm_atomic_state *state)
 	struct drm_connector *connector;
 	struct drm_connector_state *conn_state;
 	int i;
-	bool ret;
+	int ret;
 
 	for_each_crtc_in_state(state, crtc, crtc_state, i) {
 		if (!crtc_state->mode_changed &&

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch