⬢ DragonFlyBSD Kernel Audit
DF-4839 / fix.diff
← back to finding ↓ download raw
--- a/sys/dev/drm/drm_plane_helper.c
+++ b/sys/dev/drm/drm_plane_helper.c
@@ -259,11 +259,14 @@ int drm_primary_helper_update(struct drm_plane *plane, struct drm_crtc *crtc,
 		 * Primary plane isn't visible.  Note that unless a driver
 		 * provides their own disable function, this will just
 		 * wind up returning -EINVAL to userspace.
 		 */
 		return plane->funcs->disable_plane(plane, ctx);
 
 	/* Find current connectors for CRTC */
 	num_connectors = get_connectors_for_crtc(crtc, NULL, 0);
-	BUG_ON(num_connectors == 0);
+	if (num_connectors == 0) {
+		DRM_DEBUG_KMS("no connectors bound to enabled [CRTC:%d:%s]\n",
+			      crtc->base.id, crtc->name);
+		return -EINVAL;
+	}
 	connector_list = kcalloc(num_connectors, sizeof(*connector_list),
 				 GFP_KERNEL);