drm: amd: display: Fix memory leakage
authorKonstantin Meskhidze <konstantin.meskhidze@huawei.com>
Wed, 30 Nov 2022 02:50:46 +0000 (10:50 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 13 Jan 2023 19:56:01 +0000 (14:56 -0500)
This commit fixes memory leakage in dc_construct_ctx() function.

Signed-off-by: Konstantin Meskhidze <konstantin.meskhidze@huawei.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/core/dc.c

index 2c18c85..5f31087 100644 (file)
@@ -871,6 +871,7 @@ static bool dc_construct_ctx(struct dc *dc,
 
        dc_ctx->perf_trace = dc_perf_trace_create();
        if (!dc_ctx->perf_trace) {
+               kfree(dc_ctx);
                ASSERT_CRITICAL(false);
                return false;
        }