summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcin Slusarz <marcin.slusarz@gmail.com>2012-04-15 14:36:08 +0200
committerBen Skeggs <bskeggs@redhat.com>2012-05-24 16:31:54 +1000
commit5ace2c9d6f5bc4600ca43fe188a33efc4c2dba79 (patch)
tree59b194d4528fe1e3ade4655022dc7574d17053be
parentd37f60c87fbf9dca6724ed42fd55b031f88dd46a (diff)
downloadlinux-3.10-5ace2c9d6f5bc4600ca43fe188a33efc4c2dba79.tar.gz
linux-3.10-5ace2c9d6f5bc4600ca43fe188a33efc4c2dba79.tar.bz2
linux-3.10-5ace2c9d6f5bc4600ca43fe188a33efc4c2dba79.zip
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 <marcin.slusarz@gmail.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_display.c11
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 b670b0d3423..980b3e187b7 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;
}