From: Konstantin Meskhidze Date: Wed, 30 Nov 2022 02:50:46 +0000 (+0800) Subject: drm: amd: display: Fix memory leakage X-Git-Tag: v6.1.21~832 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=83ace0dd67ee386be1ddcf59dab49d6d9a54e62e;p=platform%2Fkernel%2Flinux-starfive.git drm: amd: display: Fix memory leakage [ Upstream commit 6b8701be1f66064ca72733c5f6e13748cdbf8397 ] This commit fixes memory leakage in dc_construct_ctx() function. Signed-off-by: Konstantin Meskhidze Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c index 5260ad6de803..24015f8cac75 100644 --- a/drivers/gpu/drm/amd/display/dc/core/dc.c +++ b/drivers/gpu/drm/amd/display/dc/core/dc.c @@ -878,6 +878,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; }