mirror of
https://github.com/torvalds/linux.git
synced 2024-12-21 18:42:44 +00:00
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>
This commit is contained in:
parent
d37f60c87f
commit
5ace2c9d6f
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user