Skip to content

Commit cd2d6c9

Browse files
Shirish Salexdeucher
authored andcommitted
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 <[email protected]> Signed-off-by: Shirish S <[email protected]> Reviewed-by: Harry Wentland <[email protected]> Acked-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 219be9d commit cd2d6c9

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4794,6 +4794,9 @@ static int dm_atomic_check_plane_state_fb(struct drm_atomic_state *state,
47944794
return -EDEADLK;
47954795

47964796
crtc_state = drm_atomic_get_crtc_state(plane_state->state, crtc);
4797+
if (IS_ERR(crtc_state))
4798+
return PTR_ERR(crtc_state);
4799+
47974800
if (crtc->primary == plane && crtc_state->active) {
47984801
if (!plane_state->fb)
47994802
return -EINVAL;

0 commit comments

Comments
 (0)