All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/nouveau: cleanup after display init failure
@ 2011-12-11 20:02 Marcin Slusarz
       [not found] ` <20111211200205.GA12385-OI9uyE9O0yo@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Marcin Slusarz @ 2011-12-11 20:02 UTC (permalink / raw)
  To: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

Depending on exact point of failure, not cleaning would lead to
BUG_ONs/oopses in various distant places.

Signed-off-by: Marcin Slusarz <marcin.slusarz-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
 drivers/gpu/drm/nouveau/nouveau_display.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/nouveau_display.c b/drivers/gpu/drm/nouveau/nouveau_display.c
index 05f1692..bea7a41 100644
--- a/drivers/gpu/drm/nouveau/nouveau_display.c
+++ b/drivers/gpu/drm/nouveau/nouveau_display.c
@@ -304,14 +304,21 @@ nouveau_display_create(struct drm_device *dev)
 
 	ret = disp->create(dev);
 	if (ret)
-		return ret;
+		goto disp_create_err;
 
 	if (dev->mode_config.num_crtc) {
 		ret = drm_vblank_init(dev, dev->mode_config.num_crtc);
 		if (ret)
-			return ret;
+			goto vblank_err;
 	}
 
+	return 0;
+
+vblank_err:
+	disp->destroy(dev);
+disp_create_err:
+	drm_kms_helper_poll_fini(dev);
+	drm_mode_config_cleanup(dev);
 	return ret;
 }
 
-- 
1.7.8.rc3

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

end of thread, other threads:[~2011-12-22 16:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-11 20:02 [PATCH] drm/nouveau: cleanup after display init failure Marcin Slusarz
     [not found] ` <20111211200205.GA12385-OI9uyE9O0yo@public.gmane.org>
2011-12-22 16:55   ` Marcin Slusarz

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.