Skip to content

Commit 831214f

Browse files
Ma KeAlain Volmat
authored andcommitted
drm/sti: avoid potential dereference of error pointers
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 e965e77 commit 831214f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/gpu/drm/sti/sti_cursor.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,9 @@ static int sti_cursor_atomic_check(struct drm_plane *drm_plane,
200200
return 0;
201201

202202
crtc_state = drm_atomic_get_crtc_state(state, crtc);
203+
if (IS_ERR(crtc_state))
204+
return PTR_ERR(crtc_state);
205+
203206
mode = &crtc_state->mode;
204207
dst_x = new_plane_state->crtc_x;
205208
dst_y = new_plane_state->crtc_y;

0 commit comments

Comments
 (0)