[PATCH 10/17] drm/amd/display: Fix the NULL pointer. (v2)

Harry Wentland harry.wentland at amd.com
Wed Mar 22 17:04:57 UTC 2017


From: Andrey Grodzovsky <Andrey.Grodzovsky at amd.com>

ret value in amdgpu_dm_atomic_check was not rest to EINVAL
after drm_atomic_add_affected_planes and by this making
any subsequent validation failure pass when returning
to atomic_check.

v2: Add WARN_ON print for dc_commit_streams in
amdgpu_dm_atomic_commit_tail since this should never
fail.

Change-Id: Ib12655cf88aa3e56c3f1f11456cc6ca11daaa26a
Signed-off-by: Andrey Grodzovsky <Andrey.Grodzovsky at amd.com>
Acked-by: Harry Wentland <Harry.Wentland at amd.com>
Reviewed-by: Andrey Grodzovsky <Andrey.Grodzovsky at amd.com>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_types.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_types.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_types.c
index ede895515801..34ddbe331df2 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_types.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_types.c
@@ -2563,7 +2563,7 @@ void amdgpu_dm_atomic_commit_tail(
 	}
 
 	/* DC is optimized not to do anything if 'streams' didn't change. */
-	dc_commit_streams(dm->dc, commit_streams, commit_streams_count);
+	WARN_ON(!dc_commit_streams(dm->dc, commit_streams, commit_streams_count));
 
 	list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) {
 		struct amdgpu_crtc *acrtc = to_amdgpu_crtc(crtc);
@@ -3029,6 +3029,8 @@ int amdgpu_dm_atomic_check(struct drm_device *dev,
 		ret = drm_atomic_add_affected_planes(state, crtc);
 		if (ret)
 			return ret;
+
+		ret = -EINVAL;
 	}
 
 	for (i = 0; i < set_count; i++) {
-- 
2.11.0



More information about the amd-gfx mailing list