]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/amd/display: Free memory allocation
authorClayton King <clayton.king@amd.com>
Thu, 19 Jun 2025 17:54:26 +0000 (13:54 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 16 Jul 2025 20:46:50 +0000 (16:46 -0400)
[WHY]

Free memory to avoid memory leak

Reviewed-by: Joshua Aberback <joshua.aberback@amd.com>
Signed-off-by: Clayton King <clayton.king@amd.com>
Signed-off-by: Ivan Lipski <ivan.lipski@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit fa699acb8e9be2341ee318077fa119acc7d5f329)
Cc: stable@vger.kernel.org
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn401/dcn401_clk_mgr.c

index a3b8e3d4a429e337e485ba85fa9421d805247873..4b17d2fcd56588a21ecbfaa62239713003570777 100644 (file)
@@ -1565,7 +1565,7 @@ struct clk_mgr_internal *dcn401_clk_mgr_construct(
        clk_mgr->base.bw_params = kzalloc(sizeof(*clk_mgr->base.bw_params), GFP_KERNEL);
        if (!clk_mgr->base.bw_params) {
                BREAK_TO_DEBUGGER();
-               kfree(clk_mgr);
+               kfree(clk_mgr401);
                return NULL;
        }
 
@@ -1576,6 +1576,7 @@ struct clk_mgr_internal *dcn401_clk_mgr_construct(
        if (!clk_mgr->wm_range_table) {
                BREAK_TO_DEBUGGER();
                kfree(clk_mgr->base.bw_params);
+               kfree(clk_mgr401);
                return NULL;
        }