]> git.baikalelectronics.ru Git - kernel.git/commit
drm/amd/display: Fix potential memory leak in DMUB hw_init
authorRoman Li <roman.li@amd.com>
Mon, 10 May 2021 15:58:54 +0000 (11:58 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 2 Jun 2021 21:55:10 +0000 (17:55 -0400)
commitc84da07f07b729cfd8a3e564bd0d21bceb86ccc2
tree86330f5fa61222160d7ee2b7b3f3c61fa71cfd01
parent7e159787cd93cb683529fb1dbc3ef6f369b20771
drm/amd/display: Fix potential memory leak in DMUB hw_init

[Why]
On resume we perform DMUB hw_init which allocates memory:
dm_resume->dm_dmub_hw_init->dc_dmub_srv_create->kzalloc
That results in memory leak in suspend/resume scenarios.

[How]
Allocate memory for the DC wrapper to DMUB only if it was not
allocated before.
No need to reallocate it on suspend/resume.

Signed-off-by: Lang Yu <Lang.Yu@amd.com>
Signed-off-by: Roman Li <roman.li@amd.com>
Reviewed-by: Nicholas Kazlauskas <Nicholas.Kazlauskas@amd.com>
Acked-by: Qingqing Zhuo <qingqing.zhuo@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