]> 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>
Tue, 15 Jul 2025 18:07:52 +0000 (14:07 -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>
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn401/dcn401_clk_mgr.c

index 724484573a2a40919f18b0f21fff9056037cc7ac..b59703467128834873a39a84185e86f512186019 100644 (file)
@@ -1606,7 +1606,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;
        }
 
@@ -1617,6 +1617,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;
        }