All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/amd/display: fix a potential dmub_srv memory leak
@ 2021-12-14  8:13 Lang Yu
  2021-12-14  8:13 ` [PATCH 2/2] drm/amd/display: refine error handling for dm_dmub_sw_init() Lang Yu
  0 siblings, 1 reply; 2+ messages in thread
From: Lang Yu @ 2021-12-14  8:13 UTC (permalink / raw)
  To: amd-gfx; +Cc: Alex Deucher, Huang Rui, Lang Yu, Nicholas Kazlauskas

Memory is allocated for dmub_srv in dm_sw_init(),
but not freed in dm_sw_fini(). Free it!

Signed-off-by: Lang Yu <lang.yu@amd.com>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index e65214db904c..8f6766542c73 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -2023,6 +2023,7 @@ static int dm_sw_fini(void *handle)
 
 	if (adev->dm.dmub_srv) {
 		dmub_srv_destroy(adev->dm.dmub_srv);
+		kfree(adev->dm.dmub_srv);
 		adev->dm.dmub_srv = NULL;
 	}
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-12-14  8:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-14  8:13 [PATCH 1/2] drm/amd/display: fix a potential dmub_srv memory leak Lang Yu
2021-12-14  8:13 ` [PATCH 2/2] drm/amd/display: refine error handling for dm_dmub_sw_init() Lang Yu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.