drm/amd/display: fix dereferencing possible ERR_PTR()
Subsystems (3)
PATCH 1/1 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)"
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +3 -0
@@ -4893,6 +4893,9 @@ static int dm_atomic_check_plane_state_fb(struct drm_atomic_state *state,return -EDEADLK ; crtc_state =drm_atomic_get_crtc_state (plane_state->state, crtc); +if (IS_ERR (crtc_state)) +return PTR_ERR (crtc_state); +if (crtc->primary == plane && crtc_state->active) {if (!plane_state->fb)return -EINVAL ;
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 1521110031-11510-1-git-send-email-shirish.s-5C7GfCeVMHo@public.gmane.org
Deucher, Alexander
Acked-by________________________________
From: S, Shirish
Sent: Thursday, March 15, 2018 6:33:51 AM
To: Deucher, Alexander; Wentland, Harry; [email protected]
Cc: S, Shirish
Subject: [PATCH] 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)"
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +3 -0
@@ -4893,6 +4893,9 @@ static int dm_atomic_check_plane_state_fb(struct drm_atomic_state *state,return -EDEADLK ; crtc_state =drm_atomic_get_crtc_state (plane_state->state, crtc); +if (IS_ERR (crtc_state)) +return PTR_ERR (crtc_state); +if (crtc->primary == plane && crtc_state->active) {if (!plane_state->fb)return -EINVAL ;
--
2.7.4
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Harry Wentland
Reviewed-byQuoted 6 lines · Shirish S
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 <[email protected]>Signed-off-by Shirish S <[email protected]>
Harry
Quoted 10 lines
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 +++ 1 file changed, 3 insertions(+)drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0
-0
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c static int dm_atomic_check_plane_state_fb(struct drm_atomic_state *state, · line 4901
Quoted 9 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +3
-0@@ -4893,6 +4893,9 @@ static int dm_atomic_check_plane_state_fb(struct drm_atomic_state *state,return -EDEADLK ; crtc_state =drm_atomic_get_crtc_state (plane_state->state, crtc); +if (IS_ERR (crtc_state)) +return PTR_ERR (crtc_state); +if (crtc->primary == plane && crtc_state->active) {if (!plane_state->fb)return -EINVAL ;
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx