]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 24 Jul 2025 06:58:25 +0000 (08:58 +0200)
commit b2ee9fa0fe6416e16c532f61b909c79b5d4ed282 upstream.

[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
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.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;
        }