dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/amdgpu: Fix memory leaks at amdgpu_init() error path
@ 2018-03-30 20:45 Takashi Iwai
       [not found] ` <20180330204512.16863-1-tiwai-l3A5Bk7waGM@public.gmane.org>
  0 siblings, 1 reply; 27+ messages in thread
From: Takashi Iwai @ 2018-03-30 20:45 UTC (permalink / raw)
  To: Alex Deucher; +Cc: David Airlie, dri-devel, Christian König, amd-gfx

amdgpu driver checks vgacon_text_force() after some initializations
but without cleaning up.  This will result in leaks.

Move the check of vgacon_text_force() to the beginning of
amdgpu_init() for fixing it and also for optimization.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
index 50afcf65181a..e55792d3cd12 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
@@ -905,6 +905,11 @@ static int __init amdgpu_init(void)
 {
 	int r;
 
+	if (vgacon_text_force()) {
+		DRM_ERROR("VGACON disables amdgpu kernel modesetting.\n");
+		return -EINVAL;
+	}
+
 	r = amdgpu_sync_init();
 	if (r)
 		goto error_sync;
@@ -913,10 +918,6 @@ static int __init amdgpu_init(void)
 	if (r)
 		goto error_fence;
 
-	if (vgacon_text_force()) {
-		DRM_ERROR("VGACON disables amdgpu kernel modesetting.\n");
-		return -EINVAL;
-	}
 	DRM_INFO("amdgpu kernel modesetting enabled.\n");
 	driver = &kms_driver;
 	pdriver = &amdgpu_kms_pci_driver;
-- 
2.16.2

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 27+ messages in thread

end of thread, other threads:[~2019-09-25  9:04 UTC | newest]

Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-30 20:45 [PATCH 1/2] drm/amdgpu: Fix memory leaks at amdgpu_init() error path Takashi Iwai
     [not found] ` <20180330204512.16863-1-tiwai-l3A5Bk7waGM@public.gmane.org>
2018-03-30 20:45   ` [PATCH 2/2] drm/amdgpu: Add modeset module option Takashi Iwai
     [not found]     ` <20180330204512.16863-2-tiwai-l3A5Bk7waGM@public.gmane.org>
2018-04-01 17:39       ` Christian König
     [not found]         ` <c95f9e61-c921-42de-9e03-851d785ab5fc-5C7GfCeVMHo@public.gmane.org>
2018-04-01 17:45           ` Ilia Mirkin
2018-04-01 17:58             ` Christian König
     [not found]               ` <706f4d0d-4583-2c8a-447d-f6cdd3429ad5-5C7GfCeVMHo@public.gmane.org>
2018-04-01 18:21                 ` Takashi Iwai
     [not found]                   ` <s5ho9j24wk9.wl-tiwai-l3A5Bk7waGM@public.gmane.org>
2018-04-01 20:12                     ` Christian König
     [not found]                       ` <0ecce204-6af8-2395-ac40-391e3b655bed-5C7GfCeVMHo@public.gmane.org>
2018-04-03  9:29                         ` Daniel Vetter
     [not found]                           ` <20180403092948.GQ3881-dv86pmgwkMBes7Z6vYuT8azUEOm+Xw19@public.gmane.org>
2018-04-03 11:30                             ` Christian König
2018-04-03 13:26                           ` Ilia Mirkin
     [not found]                             ` <CAKb7UvhG5nO9q1M=6fu6mnChObsskxFzgGXQPUJQCk1Q+E9ffQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-04-03 13:32                               ` Michel Dänzer
     [not found]                                 ` <ea3e89e9-0a31-604f-c3f4-2693a0f9ca92-otUistvHUpPR7s880joybQ@public.gmane.org>
2018-04-03 13:39                                   ` Ilia Mirkin
     [not found]                                     ` <CAKb7UvibPPu9O0HKbGBz7Zd9av-1YR905zH5VypiYeMRbGasGg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-04-03 13:47                                       ` Michel Dänzer
     [not found]                                         ` <957f79ce-80e9-d240-3632-e8b346708646-otUistvHUpPR7s880joybQ@public.gmane.org>
2018-04-03 14:06                                           ` Ville Syrjälä
     [not found]                                             ` <20180403140603.GA5453-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2018-04-03 15:02                                               ` Daniel Vetter
     [not found]                                                 ` <20180403150235.GV3881-dv86pmgwkMBes7Z6vYuT8azUEOm+Xw19@public.gmane.org>
2018-04-03 16:54                                                   ` Ville Syrjälä
2018-04-03 15:09                                             ` Michel Dänzer
     [not found]             ` <CAKb7Uvh_CxE=Zg_F0tentwXK64_baxs0TCQ-K9Mh_Mjf+NV_DA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-04-03  8:36               ` Michel Dänzer
2018-04-03  8:57                 ` Christian König
     [not found]                   ` <781c3a0b-e199-c637-410a-521fe5fd5170-5C7GfCeVMHo@public.gmane.org>
2018-04-03  9:02                     ` Takashi Iwai
     [not found]                       ` <s5hpo3g1x4m.wl-tiwai-l3A5Bk7waGM@public.gmane.org>
2018-04-03  9:18                         ` Michel Dänzer
2018-04-03  9:44                           ` Takashi Iwai
     [not found]                             ` <s5h1sfwk4ja.wl-tiwai-l3A5Bk7waGM@public.gmane.org>
2018-04-03 13:01                               ` Michel Dänzer
     [not found]                           ` <e4933491-65be-4b31-95de-cf1147dd312c-otUistvHUpPR7s880joybQ@public.gmane.org>
2018-04-03  9:53                             ` Jani Nikula
2019-09-25  8:07       ` Dave Airlie
2019-09-25  9:04         ` Koenig, Christian
2018-04-02 17:36   ` [PATCH 1/2] drm/amdgpu: Fix memory leaks at amdgpu_init() error path Alex Deucher

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).