Skip to content

Commit 8f8aadf

Browse files
Andy Yanmehmetb0
authored andcommitted
drm/rockchip: vop: Fix a dereferenced before check warning
BugLink: https://bugs.launchpad.net/bugs/2095283 [ Upstream commit ab1c793 ] 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 <andy.yan@rock-chips.com> Signed-off-by: Heiko Stuebner <heiko@sntech.de> Link: https://patchwork.freedesktop.org/patch/msgid/20241021072818.61621-1-andyshrk@163.com Signed-off-by: Sasha Levin <sashal@kernel.org> CVE-2024-53129 Signed-off-by: Koichiro Den <koichiro.den@canonical.com>
1 parent 4c6f30c commit 8f8aadf

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
@@ -1065,10 +1065,10 @@ static int vop_plane_atomic_async_check(struct drm_plane *plane,
10651065
if (!plane->state->fb)
10661066
return -EINVAL;
10671067

1068-
if (state)
1069-
crtc_state = drm_atomic_get_existing_crtc_state(state,
1070-
new_plane_state->crtc);
1071-
else /* Special case for asynchronous cursor updates. */
1068+
crtc_state = drm_atomic_get_existing_crtc_state(state, new_plane_state->crtc);
1069+
1070+
/* Special case for asynchronous cursor updates. */
1071+
if (!crtc_state)
10721072
crtc_state = plane->crtc->state;
10731073

10741074
return drm_atomic_helper_check_plane_state(plane->state, crtc_state,

0 commit comments

Comments
 (0)