From: Bernard Zhao Date: Tue, 23 Aug 2022 06:49:56 +0000 (-0700) Subject: drm/amd: fix potential memory leak X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=6160216fd2c97107e8a9ab39863b056d677fcd85;p=linux.git 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 Signed-off-by: Alex Deucher --- 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 3a9e3870b3a95..73f2b01fcc73f 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; }