aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShirish S <shirish.s@amd.com>2018-03-15 06:31:00 -0400
committerAlex Deucher <alexander.deucher@amd.com>2018-03-19 12:23:23 -0400
commitcd2d6c92a8e39d7e50a5af9fcc67d07e6a89e91d (patch)
tree978792228fe443114c6309d8a399e68301c0f11c
parent219be9dda6137bc9759c449bbff5d4394fe73382 (diff)
drm/amd/display: fix dereferencing possible ERR_PTR()
This patch fixes static checker warning caused by "36cc549d5986: "drm/amd/display: disable CRTCs with NULL FB on their primary plane (V2)" Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Shirish S <shirish.s@amd.com> Reviewed-by: Harry Wentland <harry.wentland@amd.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index c345e645f1d7..95b639eddcb6 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -4794,6 +4794,9 @@ static int dm_atomic_check_plane_state_fb(struct drm_atomic_state *state,
4794 return -EDEADLK; 4794 return -EDEADLK;
4795 4795
4796 crtc_state = drm_atomic_get_crtc_state(plane_state->state, crtc); 4796 crtc_state = drm_atomic_get_crtc_state(plane_state->state, crtc);
4797 if (IS_ERR(crtc_state))
4798 return PTR_ERR(crtc_state);
4799
4797 if (crtc->primary == plane && crtc_state->active) { 4800 if (crtc->primary == plane && crtc_state->active) {
4798 if (!plane_state->fb) 4801 if (!plane_state->fb)
4799 return -EINVAL; 4802 return -EINVAL;