Patch "drm/qxl: prevent memory leak" has been added to the 5.15-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: prevent memory leak

to the 5.15-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-prevent-memory-leak.patch
and it can be found in the queue-5.15 subdirectory.

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



commit b5e327780d56903165ba44e43b0c1b6a74a686da
Author: Zongmin Zhou <zhouzongmin@xxxxxxxxxx>
Date:   Tue Aug 1 10:53:09 2023 +0800

    drm/qxl: prevent memory leak
    
    [ Upstream commit 0e8b9f258baed25f1c5672613699247c76b007b5 ]
    
    The allocated memory for qdev->dumb_heads should be released
    in qxl_destroy_monitors_object before qxl suspend.
    otherwise,qxl_create_monitors_object will be called to
    reallocate memory for qdev->dumb_heads after qxl resume,
    it will cause memory leak.
    
    Signed-off-by: Zongmin Zhou <zhouzongmin@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20230801025309.4049813-1-zhouzongmin@xxxxxxxxxx
    Reviewed-by: Dave Airlie <airlied@xxxxxxxxxx>
    Signed-off-by: Maxime Ripard <mripard@xxxxxxxxxx>
    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 9e0a1e8360117..dc04412784a0d 100644
--- a/drivers/gpu/drm/qxl/qxl_display.c
+++ b/drivers/gpu/drm/qxl/qxl_display.c
@@ -1221,6 +1221,9 @@ int qxl_destroy_monitors_object(struct qxl_device *qdev)
 	if (!qdev->monitors_config_bo)
 		return 0;
 
+	kfree(qdev->dumb_heads);
+	qdev->dumb_heads = NULL;
+
 	qdev->monitors_config = NULL;
 	qdev->ram_header->monitors_config = 0;
 



[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