]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/amd/display: Fix memory leak in dcn21_clock_source_create
authorMiaoqian Lin <linmq006@gmail.com>
Thu, 21 Apr 2022 09:03:09 +0000 (17:03 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 27 Apr 2022 21:19:31 +0000 (17:19 -0400)
When dcn20_clk_src_construct() fails, we need to release clk_src.

Fixes: ee89f4065a46 ("drm/amd/display: Add Renoir resource (v2)")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c

index 3fe4bfbb98a0732fe862222704110e690b707f3c..faab59508d8292a74954ba59b602b4322647b05f 100644 (file)
@@ -997,6 +997,7 @@ static struct clock_source *dcn21_clock_source_create(
                return &clk_src->base;
        }
 
+       kfree(clk_src);
        BREAK_TO_DEBUGGER();
        return NULL;
 }