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>
Tue, 18 Apr 2023 20:28:52 +0000 (16:28 -0400)
commitc0162a05bd31129e29a23d4bd1d2321c9663d5bc
tree2b1becf32db3fe30955a533a368a17d901bf2837
parent72529b683c6d94fa87f3a42efd9b92ccfb8def41
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