All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdgpu: update connector num_modes
@ 2020-11-09  5:59 Lee Starnes
  0 siblings, 0 replies; only message in thread
From: Lee Starnes @ 2020-11-09  5:59 UTC (permalink / raw)
  To: amd-gfx, alexander.deucher, christian.koenig, stylon.wang

In amdgpu_dm.c, amdgpu_dm_update_connector_after_detect calls
drm_add_edid_modes, but it doesn't update the struct
amdgpu_dm_connector's num_modes like other places that call
drm_add_edid_modes do, so drm_display_modes allocated by
drm_add_edid_modes will never get freed. This causes a memleak which was
reported as https://bugzilla.kernel.org/show_bug.cgi?id=209987. It's
severe enough that it caused my system to OOM and have to be rebooted
several times.

The commit that causes this was backported to 5.9 and 5.4.

Fixes: b24bdc37d03a ("drm/amd/display: Fix EDID parsing after resume from suspend")
Cc: stable@vger.kernel.org
Signed-off-by: Lee Starnes <lee@canned-death.us>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index e93e18c06..06fe24a9d 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -2281,7 +2281,7 @@ void amdgpu_dm_update_connector_after_detect(
 
 			drm_connector_update_edid_property(connector,
 							   aconnector->edid);
-			drm_add_edid_modes(connector, aconnector->edid);
+			aconnector->num_modes = drm_add_edid_modes(connector, aconnector->edid);
 
 			if (aconnector->dc_link->aux_mode)
 				drm_dp_cec_set_edid(&aconnector->dm_dp_aux.aux,
-- 
2.29.2

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2020-11-09  8:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-09  5:59 [PATCH] drm/amdgpu: update connector num_modes Lee Starnes

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.