Patch "drm/qxl: Add check for drm_cvt_mode" has been added to the 5.4-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/qxl: Add check for drm_cvt_mode

to the 5.4-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-qxl-add-check-for-drm_cvt_mode.patch
and it can be found in the queue-5.4 subdirectory.

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



commit ad331d08d4149c0453f05cbf1977bcb1b2b72976
Author: Chen Ni <nichen@xxxxxxxxxxx>
Date:   Fri Jun 21 15:10:31 2024 +0800

    drm/qxl: Add check for drm_cvt_mode
    
    [ Upstream commit 7bd09a2db0f617377027a2bb0b9179e6959edff3 ]
    
    Add check for the return value of drm_cvt_mode() and return the error if
    it fails in order to avoid NULL pointer dereference.
    
    Fixes: 1b043677d4be ("drm/qxl: add qxl_add_mode helper function")
    Signed-off-by: Chen Ni <nichen@xxxxxxxxxxx>
    Reviewed-by: Heng Qi <hengqi@xxxxxxxxxxxxxxxxx>
    Signed-off-by: Maxime Ripard <mripard@xxxxxxxxxx>
    Link: https://patchwork.freedesktop.org/patch/msgid/20240621071031.1987974-1-nichen@xxxxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm/qxl/qxl_display.c
index a6ee10cbcfdd6..677dd560c066d 100644
--- a/drivers/gpu/drm/qxl/qxl_display.c
+++ b/drivers/gpu/drm/qxl/qxl_display.c
@@ -230,6 +230,9 @@ static int qxl_add_mode(struct drm_connector *connector,
 		return 0;
 
 	mode = drm_cvt_mode(dev, width, height, 60, false, false, false);
+	if (!mode)
+		return 0;
+
 	if (preferred)
 		mode->type |= DRM_MODE_TYPE_PREFERRED;
 	mode->hdisplay = width;




[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