<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<p style="font-family:Arial;font-size:11pt;color:#0078D7;margin:5pt;" align="Left">
[AMD Official Use Only - Internal Distribution Only]<br>
</p>
<br>
<div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
This leak is still present. Can we get this applied?</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Acked-by: Alex Deucher <alexander.deucher@amd.com><br>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Wang, Chao-kai (Stylon) <Stylon.Wang@amd.com><br>
<b>Sent:</b> Tuesday, November 10, 2020 2:49 AM<br>
<b>To:</b> amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org><br>
<b>Cc:</b> Wang, Chao-kai (Stylon) <Stylon.Wang@amd.com>; Kazlauskas, Nicholas <Nicholas.Kazlauskas@amd.com>; Deucher, Alexander <Alexander.Deucher@amd.com>; Wentland, Harry <Harry.Wentland@amd.com><br>
<b>Subject:</b> [PATCH] drm/amd/display: Fix memory leaks in S3 resume</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">EDID parsing in S3 resume pushes new display modes<br>
to probed_modes list but doesn't consolidate to actual<br>
mode list. This creates a race condition when<br>
amdgpu_dm_connector_ddc_get_modes() re-initializes the<br>
list head without walking the list and results in memory leak.<br>
<br>
Signed-off-by: Stylon Wang <stylon.wang@amd.com><br>
---<br>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 ++-<br>
1 file changed, 2 insertions(+), 1 deletion(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c<br>
index 0b6adf23d316..715e0bd489f8 100644<br>
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c<br>
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c<br>
@@ -2337,7 +2337,8 @@ void amdgpu_dm_update_connector_after_detect(<br>
<br>
drm_connector_update_edid_property(connector,<br>
aconnector->edid);<br>
- drm_add_edid_modes(connector, aconnector->edid);<br>
+ aconnector->num_modes = drm_add_edid_modes(connector, aconnector->edid);<br>
+ drm_connector_list_update(connector);<br>
<br>
if (aconnector->dc_link->aux_mode)<br>
drm_dp_cec_set_edid(&aconnector->dm_dp_aux.aux,<br>
-- <br>
2.25.1<br>
<br>
</div>
</span></font></div>
</div>
</body>
</html>