]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
drm/amd: fix potential memory leak
authorBernard Zhao <bernard@vivo.com>
Tue, 23 Aug 2022 06:49:56 +0000 (23:49 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 21 Oct 2022 10:39:13 +0000 (12:39 +0200)
[ 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 <bernard@vivo.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c

index 3cd7c91655c59e10f0c1ccc3a820fd392f36794e..6d721fadcbee62b07779940284cbb99f0338d41c 100644 (file)
@@ -1720,6 +1720,7 @@ static struct clock_source *dcn30_clock_source_create(
        }
 
        BREAK_TO_DEBUGGER();
+       kfree(clk_src);
        return NULL;
 }