⬢ DragonFlyBSD Kernel Audit
DF-4532 / fix.diff
← back to finding ↓ download raw
--- a/sys/dev/drm/drm_file.c
+++ b/sys/dev/drm/drm_file.c
@@ -444,6 +444,11 @@
 
 	drm_minor_release(minor);
 
+	/* Balance the device_busy() done by drm_open() on success: with no
+	 * matching unbusy the device stayed DS_BUSY forever after the first
+	 * open, permanently blocking device_detach()/kldunload. */
+	device_unbusy(dev->dev->bsddev);
+
 	return 0;
 }
 EXPORT_SYMBOL(drm_close);