drm/crtc: fix uninitialized variable use
authorjsg <jsg@openbsd.org>
Mon, 22 Jan 2024 03:16:43 +0000 (03:16 +0000)
committerjsg <jsg@openbsd.org>
Mon, 22 Jan 2024 03:16:43 +0000 (03:16 +0000)
From Jani Nikula
7e881af7fb3c2ddc0c29b249250606fbe004f353 in linux-6.6.y/6.6.13
6e455f5dcdd15fa28edf0ffb5b44d3508512dccf in mainline linux

sys/dev/pci/drm/drm_crtc.c

index d45638a..ee349e6 100644 (file)
@@ -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;