aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/files/0667-drm-amd-dal-Deallocate-dc-ctx-upon-destruct.patch
blob: 54bd9ae285ce0dc84d5bbf663312178d4fa88fbd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
From b95ac9aabb5be346a107ac4d9f8e12c0aefe62f3 Mon Sep 17 00:00:00 2001
From: Chris Park <Chris.Park@amd.com>
Date: Wed, 6 Jan 2016 11:37:40 -0500
Subject: [PATCH 0667/1110] drm/amd/dal: Deallocate dc->ctx upon destruct

Signed-off-by: Chris Park <Chris.Park@amd.com>
Acked-by: Jordan Lazare <Jordan.Lazare@amd.com>
---
 drivers/gpu/drm/amd/dal/dc/core/dc.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/dal/dc/core/dc.c b/drivers/gpu/drm/amd/dal/dc/core/dc.c
index 662df13..96ec35f 100644
--- a/drivers/gpu/drm/amd/dal/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/dal/dc/core/dc.c
@@ -362,6 +362,7 @@ static void destruct(struct dc *dc)
 	dc_service_free(dc->ctx, dc->links);
 	dc->hwss.destruct_resource_pool(&dc->res_pool);
 	dal_logger_destroy(&dc->ctx->logger);
+	dc_service_free(dc->ctx, dc->ctx);
 }
 
 /*******************************************************************************
@@ -397,8 +398,9 @@ alloc_fail:
 
 void dc_destroy(struct dc **dc)
 {
+	struct dc_context ctx = *(*dc)->ctx;
 	destruct(*dc);
-	dc_service_free((*dc)->ctx, *dc);
+	dc_service_free(&ctx, *dc);
 	*dc = NULL;
 }
 
-- 
2.7.4