summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHangyu Hua <hbh25y@gmail.com>2022-05-16 11:20:42 +0800
committerLyude Paul <lyude@redhat.com>2022-05-17 15:56:18 -0400
commit6e03b13cc7d9427c2c77feed1549191015615202 (patch)
treefbcdee157f58b00b10c5e19af1c1a064548c9a8f
parent7c3e9fcad9c7d8bb5d69a576044fb16b1d2e8a01 (diff)
drm/dp/mst: fix a possible memory leak in fetch_monitor_name()drm-misc-fixes-2022-05-20
drm_dp_mst_get_edid call kmemdup to create mst_edid. So mst_edid need to be freed after use. Signed-off-by: Hangyu Hua <hbh25y@gmail.com> Reviewed-by: Lyude Paul <lyude@redhat.com> Signed-off-by: Lyude Paul <lyude@redhat.com> Cc: stable@vger.kernel.org Link: https://patchwork.freedesktop.org/patch/msgid/20220516032042.13166-1-hbh25y@gmail.com
-rw-r--r--drivers/gpu/drm/dp/drm_dp_mst_topology.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/gpu/drm/dp/drm_dp_mst_topology.c b/drivers/gpu/drm/dp/drm_dp_mst_topology.c
index 11300b53d24f..7a7cc44686f9 100644
--- a/drivers/gpu/drm/dp/drm_dp_mst_topology.c
+++ b/drivers/gpu/drm/dp/drm_dp_mst_topology.c
@@ -4852,6 +4852,7 @@ static void fetch_monitor_name(struct drm_dp_mst_topology_mgr *mgr,
mst_edid = drm_dp_mst_get_edid(port->connector, mgr, port);
drm_edid_get_monitor_name(mst_edid, name, namelen);
+ kfree(mst_edid);
}
/**