drm: amd: display: Fix memory leakage
authorjsg <jsg@openbsd.org>
Mon, 27 Mar 2023 03:55:01 +0000 (03:55 +0000)
committerjsg <jsg@openbsd.org>
Mon, 27 Mar 2023 03:55:01 +0000 (03:55 +0000)
From Konstantin Meskhidze
83ace0dd67ee386be1ddcf59dab49d6d9a54e62e in linux-6.1.y/6.1.16
6b8701be1f66064ca72733c5f6e13748cdbf8397 in mainline linux

sys/dev/pci/drm/amd/display/dc/core/amdgpu_dc.c

index 5260ad6..24015f8 100644 (file)
@@ -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;
        }