Patch "drm/nouveau/dp: check for NULL nv_connector->native_mode" 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/nouveau/dp: check for NULL nv_connector->native_mode

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-nouveau-dp-check-for-null-nv_connector-native_mo.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 44f973858ae0211ded9d9a068d946ffe825ca075
Author: Natalia Petrova <n.petrova@xxxxxxxxxx>
Date:   Fri May 12 14:15:26 2023 +0300

    drm/nouveau/dp: check for NULL nv_connector->native_mode
    
    [ Upstream commit 20a2ce87fbaf81e4c3dcb631d738e423959eb320 ]
    
    Add checking for NULL before calling nouveau_connector_detect_depth() in
    nouveau_connector_get_modes() function because nv_connector->native_mode
    could be dereferenced there since connector pointer passed to
    nouveau_connector_detect_depth() and the same value of
    nv_connector->native_mode is used there.
    
    Found by Linux Verification Center (linuxtesting.org) with SVACE.
    
    Fixes: d4c2c99bdc83 ("drm/nouveau/dp: remove broken display depth function, use the improved one")
    
    Signed-off-by: Natalia Petrova <n.petrova@xxxxxxxxxx>
    Reviewed-by: Lyude Paul <lyude@xxxxxxxxxx>
    Signed-off-by: Lyude Paul <lyude@xxxxxxxxxx>
    Link: https://patchwork.freedesktop.org/patch/msgid/20230512111526.82408-1-n.petrova@xxxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/gpu/drm/nouveau/nouveau_connector.c b/drivers/gpu/drm/nouveau/nouveau_connector.c
index 9542fc63e7968..7478f2a1411e6 100644
--- a/drivers/gpu/drm/nouveau/nouveau_connector.c
+++ b/drivers/gpu/drm/nouveau/nouveau_connector.c
@@ -946,7 +946,7 @@ nouveau_connector_get_modes(struct drm_connector *connector)
 	/* Determine display colour depth for everything except LVDS now,
 	 * DP requires this before mode_valid() is called.
 	 */
-	if (connector->connector_type != DRM_MODE_CONNECTOR_LVDS)
+	if (connector->connector_type != DRM_MODE_CONNECTOR_LVDS && nv_connector->native_mode)
 		nouveau_connector_detect_depth(connector);
 
 	/* Find the native mode if this is a digital panel, if we didn't
@@ -967,7 +967,7 @@ nouveau_connector_get_modes(struct drm_connector *connector)
 	 * "native" mode as some VBIOS tables require us to use the
 	 * pixel clock as part of the lookup...
 	 */
-	if (connector->connector_type == DRM_MODE_CONNECTOR_LVDS)
+	if (connector->connector_type == DRM_MODE_CONNECTOR_LVDS && nv_connector->native_mode)
 		nouveau_connector_detect_depth(connector);
 
 	if (nv_encoder->dcb->type == DCB_OUTPUT_TV)



[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