drm/amd/display: fix memleak in aconnector->timing_requested
authorHersen Wu <hersenxs.wu@amd.com>
Mon, 27 Mar 2023 13:10:48 +0000 (09:10 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 27 Apr 2023 02:28:37 +0000 (22:28 -0400)
commit025ce392b5f213696ca0af3e07735d0fae020694
treea8a4170a5da9ae77fe382e3547de47f39fd2b510
parentda5e14909776edea4462672fb4a3007802d262e7
drm/amd/display: fix memleak in aconnector->timing_requested

[Why]
when amdgpu_dm_update_connector_after_detect is called
two times successively with valid sink, memory allocated of
aconnector->timing_requested for the first call is not free.
this causes memeleak.

[How]
allocate memory only when aconnector->timing_requested
is null.

Reviewed-by: Qingqing Zhuo <Qingqing.Zhuo@amd.com>
Acked-by: Qingqing Zhuo <qingqing.zhuo@amd.com>
Signed-off-by: Hersen Wu <hersenxs.wu@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c