From: Marcin Slusarz Date: Sun, 15 Apr 2012 12:36:08 +0000 (+0200) Subject: drm/nouveau: cleanup after display init failure X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=5ace2c9d6f5bc4600ca43fe188a33efc4c2dba79;p=linux-beck.git drm/nouveau: cleanup after display init failure Depending on exact point of failure, not cleaning would lead to BUG_ONs/oopses in various distant places. Signed-off-by: Marcin Slusarz Signed-off-by: Ben Skeggs --- diff --git a/drivers/gpu/drm/nouveau/nouveau_display.c b/drivers/gpu/drm/nouveau/nouveau_display.c index b670b0d34233..980b3e187b72 100644 --- a/drivers/gpu/drm/nouveau/nouveau_display.c +++ b/drivers/gpu/drm/nouveau/nouveau_display.c @@ -325,14 +325,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; }