From: Bernard Zhao Date: Tue, 23 Aug 2022 06:35:24 +0000 (-0700) Subject: drm/amd: fix potential memory leak X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=d200a64305f7072db918e68b8caef0b33e55ef05;p=linux.git drm/amd: fix potential memory leak This patch fix potential memory leak (clk_src) when function run into last return NULL. 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 73f2b01fcc73f..97dc5ee475a14 100644 --- a/drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c +++ b/drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c @@ -1643,6 +1643,7 @@ static struct clock_source *dcn31_clock_source_create( } BREAK_TO_DEBUGGER(); + kfree(clk_src); return NULL; }