Skip to content

Commit 37c2caa

Browse files
Alex Hungalexdeucher
authored andcommitted
drm/amd/display: Fix drm_edid leak in amdgpu_dm
[WHAT] When a sink is connected, aconnector->drm_edid was overwritten without freeing the previous allocation, causing a memory leak on resume. [HOW] Free the previous drm_edid before updating it. Reviewed-by: Roman Li <roman.li@amd.com> Signed-off-by: Alex Hung <alex.hung@amd.com> Signed-off-by: Chuanyu Tseng <chuanyu.tseng@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> (cherry picked from commit 52024a9) Cc: stable@vger.kernel.org
1 parent 14b81ab commit 37c2caa

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3909,8 +3909,9 @@ void amdgpu_dm_update_connector_after_detect(
39093909

39103910
aconnector->dc_sink = sink;
39113911
dc_sink_retain(aconnector->dc_sink);
3912+
drm_edid_free(aconnector->drm_edid);
3913+
aconnector->drm_edid = NULL;
39123914
if (sink->dc_edid.length == 0) {
3913-
aconnector->drm_edid = NULL;
39143915
hdmi_cec_unset_edid(aconnector);
39153916
if (aconnector->dc_link->aux_mode) {
39163917
drm_dp_cec_unset_edid(&aconnector->dm_dp_aux.aux);

0 commit comments

Comments
 (0)