Skip to contentSkip to conversation

drm/rockchip: vop2: fix initialization of possible_crtcs variable

PATCH New Michael Riesch 1 participant 1 message Mar 15, 2023

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/rockchip: vop2: fix initialization of possible_crtcs variable

The variable possible_crtcs is not initialized properly since commit 604be85547ce ("drm/rockchip: Add VOP2 driver"). A first attempt to fix this issue has been made in commit 368419a2d429 ("drm/rockchip: vop2: initialize possible_crtcs properly") but turned out to be incomplete. Initialize the variable with zero to cover all possible paths.

Fixes 368419a2d429 ("drm/rockchip: vop2: initialize possible_crtcs properly")
---
 drivers/gpu/drm/rockchip/rockchip_drm_vop2.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/gpu/drm/rockchip/rockchip_drm_vop2.c +1 -3
index 1667e5324b29..0569f1211d9b 100644
@@ -2301,7 +2301,7 @@ static int vop2_create_crtcs(struct vop2 *vop2)
 	nvp = 0;
 	for (i = 0; i < vop2->registered_num_wins; i++) {
 		struct vop2_win *win = &vop2->win[i];
-		u32 possible_crtcs;
+		u32 possible_crtcs = 0;
 
 		if (vop2->data->soc_id == 3566) {
 			/*
@@ -2329,8 +2329,6 @@ static int vop2_create_crtcs(struct vop2 *vop2)
 			}
 		} else if (win->type == DRM_PLANE_TYPE_OVERLAY) {
 			possible_crtcs = (1 << nvps) - 1;
-		} else {
-			possible_crtcs = 0;
 		}
 
 		ret = vop2_plane_init(vop2, win, possible_crtcs);
Signature · 1 line
2.30.2