drm/amd: fix potential memory leak
authorBernard Zhao <bernard@vivo.com>
Tue, 23 Aug 2022 06:49:56 +0000 (23:49 -0700)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 25 Aug 2022 17:35:18 +0000 (13:35 -0400)
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>
drivers/gpu/drm/amd/display/dc/dcn314/dcn314_resource.c

index 3a9e3870b3a95f223b18563d126befc657d28d6a..73f2b01fcc73fcae119cab7e3e74486b6f0cb138 100644 (file)
@@ -1715,6 +1715,7 @@ static struct clock_source *dcn30_clock_source_create(
        }
 
        BREAK_TO_DEBUGGER();
+       kfree(clk_src);
        return NULL;
 }