Skip to content

Commit ab1c793

Browse files
Andy Yanmmind
authored andcommitted
drm/rockchip: vop: Fix a dereferenced before check warning
The 'state' can't be NULL, we should check crtc_state. Fix warning: drivers/gpu/drm/rockchip/rockchip_drm_vop.c:1096 vop_plane_atomic_async_check() warn: variable dereferenced before check 'state' (see line 1077) Fixes: 5ddb0bd ("drm/atomic: Pass the full state to planes async atomic check and update") Signed-off-by: Andy Yan <[email protected]> Signed-off-by: Heiko Stuebner <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent f432a16 commit ab1c793

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/gpu/drm/rockchip/rockchip_drm_vop.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1093,10 +1093,10 @@ static int vop_plane_atomic_async_check(struct drm_plane *plane,
10931093
if (!plane->state->fb)
10941094
return -EINVAL;
10951095

1096-
if (state)
1097-
crtc_state = drm_atomic_get_existing_crtc_state(state,
1098-
new_plane_state->crtc);
1099-
else /* Special case for asynchronous cursor updates. */
1096+
crtc_state = drm_atomic_get_existing_crtc_state(state, new_plane_state->crtc);
1097+
1098+
/* Special case for asynchronous cursor updates. */
1099+
if (!crtc_state)
11001100
crtc_state = plane->crtc->state;
11011101

11021102
return drm_atomic_helper_check_plane_state(plane->state, crtc_state,

0 commit comments

Comments
 (0)