Patch "drm/crtc: fix uninitialized variable use" has been added to the 5.10-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    drm/crtc: fix uninitialized variable use

to the 5.10-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     drm-crtc-fix-uninitialized-variable-use.patch
and it can be found in the queue-5.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit a0c48b9da4c0fa4eb30ebb1ad7ea86b96f507326
Author: Jani Nikula <jani.nikula@xxxxxxxxx>
Date:   Fri Dec 8 15:12:38 2023 +0200

    drm/crtc: fix uninitialized variable use
    
    [ Upstream commit 6e455f5dcdd15fa28edf0ffb5b44d3508512dccf ]
    
    Commit 3823119b9c2b ("drm/crtc: Fix uninit-value bug in
    drm_mode_setcrtc") was supposed to fix use of an uninitialized variable,
    but introduced another.
    
    num_connectors is only initialized if crtc_req->count_connectors > 0,
    but it's used regardless. Fix it.
    
    Fixes: 3823119b9c2b ("drm/crtc: Fix uninit-value bug in drm_mode_setcrtc")
    Cc: syzbot+4fad2e57beb6397ab2fc@xxxxxxxxxxxxxxxxxxxxxxxxx
    Cc: Ziqi Zhao <astrajoan@xxxxxxxxx>
    Cc: Maxime Ripard <mripard@xxxxxxxxxx>
    Cc: Maarten Lankhorst <maarten.lankhorst@xxxxxxxxxxxxxxx>
    Cc: Thomas Zimmermann <tzimmermann@xxxxxxx>
    Signed-off-by: Jani Nikula <jani.nikula@xxxxxxxxx>
    Signed-off-by: Maxime Ripard <mripard@xxxxxxxxxx>
    Link: https://patchwork.freedesktop.org/patch/msgid/20231208131238.2924571-1-jani.nikula@xxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c
index b3c0a9ea8c6f..4ed3fc28d4da 100644
--- a/drivers/gpu/drm/drm_crtc.c
+++ b/drivers/gpu/drm/drm_crtc.c
@@ -562,7 +562,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;
@@ -700,7 +700,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;




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux