Skip to content

Commit c1ab40a

Browse files
Ma KeAlain Volmat
authored andcommitted
drm/sti: avoid potential dereference of error pointers in sti_hqvdp_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]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Alain Volmat <[email protected]>
1 parent 87054ec commit c1ab40a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/gpu/drm/sti/sti_hqvdp.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1037,6 +1037,9 @@ static int sti_hqvdp_atomic_check(struct drm_plane *drm_plane,
10371037
return 0;
10381038

10391039
crtc_state = drm_atomic_get_crtc_state(state, crtc);
1040+
if (IS_ERR(crtc_state))
1041+
return PTR_ERR(crtc_state);
1042+
10401043
mode = &crtc_state->mode;
10411044
dst_x = new_plane_state->crtc_x;
10421045
dst_y = new_plane_state->crtc_y;

0 commit comments

Comments
 (0)