From: jsg Date: Mon, 29 Jan 2024 01:32:31 +0000 (+0000) Subject: drm/drv: propagate errors from drm_modeset_register_all() X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=52c0679993f9c6206c6475253b73b345666bbe5a;p=openbsd drm/drv: propagate errors from drm_modeset_register_all() From Dmitry Baryshkov af9d39677c919f5c7dc67675aa0d30f7793bd324 in linux-6.6.y/6.6.14 5f8dec200923a76dc57187965fd59c1136f5d085 in mainline linux --- diff --git a/sys/dev/pci/drm/drm_drv.c b/sys/dev/pci/drm/drm_drv.c index 74adff50a16..4193f4ce1c3 100644 --- a/sys/dev/pci/drm/drm_drv.c +++ b/sys/dev/pci/drm/drm_drv.c @@ -1042,8 +1042,11 @@ int drm_dev_register(struct drm_device *dev, unsigned long flags) goto err_minors; } - if (drm_core_check_feature(dev, DRIVER_MODESET)) - drm_modeset_register_all(dev); + if (drm_core_check_feature(dev, DRIVER_MODESET)) { + ret = drm_modeset_register_all(dev); + if (ret) + goto err_unload; + } DRM_INFO("Initialized %s %d.%d.%d %s for %s on minor %d\n", driver->name, driver->major, driver->minor, @@ -1053,6 +1056,9 @@ int drm_dev_register(struct drm_device *dev, unsigned long flags) goto out_unlock; +err_unload: + if (dev->driver->unload) + dev->driver->unload(dev); err_minors: remove_compat_control_link(dev); drm_minor_unregister(dev, DRM_MINOR_ACCEL);