From: Andrey Grodzovsky Date: Thu, 16 Mar 2017 19:51:00 +0000 (-0400) Subject: drm/amd/display: Fix the NULL pointer. (v2) X-Git-Tag: v5.15~9960^2~23^2~628 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=53d35dc60d386cdf1d04a318dc010524bf5607a3;p=platform%2Fkernel%2Flinux-starfive.git drm/amd/display: Fix the NULL pointer. (v2) 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. Signed-off-by: Andrey Grodzovsky Acked-by: Harry Wentland Reviewed-by: Andrey Grodzovsky Signed-off-by: Alex Deucher --- 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 1c1c643..7f2d177 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 @@ -2392,7 +2392,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); @@ -2858,6 +2858,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++) {