Skip to content

Commit 0e8b9f2

Browse files
Zongmin Zhoumripard
authored andcommitted
drm/qxl: prevent memory leak
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Dave Airlie <[email protected]> Signed-off-by: Maxime Ripard <[email protected]>
1 parent 101c9f6 commit 0e8b9f2

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/gpu/drm/qxl/qxl_display.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1229,6 +1229,9 @@ int qxl_destroy_monitors_object(struct qxl_device *qdev)
12291229
if (!qdev->monitors_config_bo)
12301230
return 0;
12311231

1232+
kfree(qdev->dumb_heads);
1233+
qdev->dumb_heads = NULL;
1234+
12321235
qdev->monitors_config = NULL;
12331236
qdev->ram_header->monitors_config = 0;
12341237

0 commit comments

Comments
 (0)