From: Bernard Zhao Date: Tue, 23 Aug 2022 06:49:56 +0000 (-0700) Subject: drm/amd: fix potential memory leak X-Git-Tag: v6.0.3~125 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a6e6ab9caeac96b277a3fe7da1dfa8f69a591759;p=thirdparty%2Fkernel%2Fstable.git drm/amd: fix potential memory leak [ Upstream commit 6160216fd2c97107e8a9ab39863b056d677fcd85 ] 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 Signed-off-by: Sasha Levin --- 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 3cd7c91655c59..6d721fadcbee6 100644 --- a/drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c +++ b/drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c @@ -1720,6 +1720,7 @@ static struct clock_source *dcn30_clock_source_create( } BREAK_TO_DEBUGGER(); + kfree(clk_src); return NULL; }