This allows us to disable usb(4) without kernel crash.
authormglocker <mglocker@openbsd.org>
Sun, 5 Sep 2021 16:16:13 +0000 (16:16 +0000)
committermglocker <mglocker@openbsd.org>
Sun, 5 Sep 2021 16:16:13 +0000 (16:16 +0000)
ok mpi@

sys/dev/usb/usb.c

index b894388..12c57c8 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: usb.c,v 1.127 2021/01/29 16:59:41 sthen Exp $ */
+/*     $OpenBSD: usb.c,v 1.128 2021/09/05 16:16:13 mglocker Exp $      */
 /*     $NetBSD: usb.c,v 1.77 2003/01/01 00:10:26 thorpej Exp $ */
 
 /*
@@ -883,6 +883,10 @@ usb_schedsoftintr(struct usbd_bus *bus)
 {
        DPRINTFN(10,("%s: polling=%d\n", __func__, bus->use_polling));
 
+       /* In case usb(4) is disabled */
+       if (bus->soft == NULL)
+               return;
+
        if (bus->use_polling) {
                bus->methods->soft_intr(bus);
        } else {