From: jsg Date: Mon, 22 Jan 2024 03:16:43 +0000 (+0000) Subject: drm/crtc: fix uninitialized variable use X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=65dd6bd22779ab727c1f34c90eb93ba0de2d1432;p=openbsd drm/crtc: fix uninitialized variable use From Jani Nikula 7e881af7fb3c2ddc0c29b249250606fbe004f353 in linux-6.6.y/6.6.13 6e455f5dcdd15fa28edf0ffb5b44d3508512dccf in mainline linux --- 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;