From 65dd6bd22779ab727c1f34c90eb93ba0de2d1432 Mon Sep 17 00:00:00 2001 From: jsg Date: Mon, 22 Jan 2024 03:16:43 +0000 Subject: [PATCH] drm/crtc: fix uninitialized variable use From Jani Nikula 7e881af7fb3c2ddc0c29b249250606fbe004f353 in linux-6.6.y/6.6.13 6e455f5dcdd15fa28edf0ffb5b44d3508512dccf in mainline linux --- sys/dev/pci/drm/drm_crtc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sys/dev/pci/drm/drm_crtc.c b/sys/dev/pci/drm/drm_crtc.c index d45638a1f5f..ee349e64a50 100644 --- a/sys/dev/pci/drm/drm_crtc.c +++ b/sys/dev/pci/drm/drm_crtc.c @@ -715,7 +715,7 @@ int drm_mode_setcrtc(struct drm_device *dev, void *data, struct drm_mode_set set; uint32_t __user *set_connectors_ptr; struct drm_modeset_acquire_ctx ctx; - int ret, i, num_connectors; + int ret, i, num_connectors = 0; if (!drm_core_check_feature(dev, DRIVER_MODESET)) return -EOPNOTSUPP; @@ -850,7 +850,6 @@ int drm_mode_setcrtc(struct drm_device *dev, void *data, goto out; } - num_connectors = 0; for (i = 0; i < crtc_req->count_connectors; i++) { connector_set[i] = NULL; set_connectors_ptr = (uint32_t __user *)(unsigned long)crtc_req->set_connectors_ptr; -- 2.20.1