Skip to content

Commit

Permalink
drm/amd/display: Fix potential memory leak
Browse files Browse the repository at this point in the history
[ Upstream commit 51ba691 ]

[Why]
vblank_workqueue is never released.

[How]
Free it upon dm finish.

Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Qingqing Zhuo <qingqing.zhuo@amd.com>
Reviewed-by: Nicholas Kazlauskas <Nicholas.Kazlauskas@amd.com>
Acked-by: Solomon Chiu <solomon.chiu@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Qingqing Zhuo authored and gregkh committed May 12, 2021
1 parent 563ac62 commit b454762
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
Expand Up @@ -1191,6 +1191,15 @@ static void amdgpu_dm_fini(struct amdgpu_device *adev)
if (adev->dm.dc)
dc_deinit_callbacks(adev->dm.dc);
#endif

#if defined(CONFIG_DRM_AMD_DC_DCN)
if (adev->dm.vblank_workqueue) {
adev->dm.vblank_workqueue->dm = NULL;
kfree(adev->dm.vblank_workqueue);
adev->dm.vblank_workqueue = NULL;
}
#endif

if (adev->dm.dc->ctx->dmub_srv) {
dc_dmub_srv_destroy(&adev->dm.dc->ctx->dmub_srv);
adev->dm.dc->ctx->dmub_srv = NULL;
Expand Down

0 comments on commit b454762

Please sign in to comment.