aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBernard Zhao <bernard@vivo.com>2022-08-22 23:49:56 -0700
committerAlex Deucher <alexander.deucher@amd.com>2022-08-25 13:35:18 -0400
commit6160216fd2c97107e8a9ab39863b056d677fcd85 (patch)
tree5e5125514f3480d1ecbbd7b2a7095ef6e9105375
parentdrm/amdgpu: mmVM_L2_CNTL3 register not initialized correctly (diff)
downloadlinux-dev-6160216fd2c97107e8a9ab39863b056d677fcd85.tar.xz
linux-dev-6160216fd2c97107e8a9ab39863b056d677fcd85.zip
drm/amd: fix potential memory leak
This patch fix potential memory leak (clk_src) when function run into last return NULL. s/free/kfree/ - Alex Signed-off-by: Bernard Zhao <bernard@vivo.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c b/drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c
index 3a9e3870b3a9..73f2b01fcc73 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c
@@ -1715,6 +1715,7 @@ static struct clock_source *dcn30_clock_source_create(
}
BREAK_TO_DEBUGGER();
+ kfree(clk_src);
return NULL;
}