Skip to content

Commit e965e77

Browse files
Ma KeAlain Volmat
authored andcommitted
drm/sti: avoid potential dereference of error pointers in sti_gdp_atomic_check
The return value of drm_atomic_get_crtc_state() needs to be checked. To avoid use of error pointer 'crtc_state' in case of the failure. Cc: [email protected] Fixes: dd86dc2 ("drm/sti: implement atomic_check for the planes") Signed-off-by: Ma Ke <[email protected]> Acked-by: Alain Volmat <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Alain Volmat <[email protected]>
1 parent c1ab40a commit e965e77

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/gpu/drm/sti/sti_gdp.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -638,6 +638,9 @@ static int sti_gdp_atomic_check(struct drm_plane *drm_plane,
638638

639639
mixer = to_sti_mixer(crtc);
640640
crtc_state = drm_atomic_get_crtc_state(state, crtc);
641+
if (IS_ERR(crtc_state))
642+
return PTR_ERR(crtc_state);
643+
641644
mode = &crtc_state->mode;
642645
dst_x = new_plane_state->crtc_x;
643646
dst_y = new_plane_state->crtc_y;

0 commit comments

Comments
 (0)