Skip to content

Commit

Permalink
drm/dp/mst: fix a possible memory leak in fetch_monitor_name()
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Lyude Paul <[email protected]>
Signed-off-by: Lyude Paul <[email protected]>
Cc: [email protected]
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
  • Loading branch information
HBh25Y authored and Lyude committed May 17, 2022
1 parent 7c3e9fc commit 6e03b13
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/gpu/drm/dp/drm_dp_mst_topology.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/**
Expand Down

0 comments on commit 6e03b13

Please sign in to comment.