summaryrefslogtreecommitdiff
path: root/sys/dev/usb/usb.c
diff options
context:
space:
mode:
authorMarcus Glocker <mglocker@cvs.openbsd.org>2021-09-05 16:16:14 +0000
committerMarcus Glocker <mglocker@cvs.openbsd.org>2021-09-05 16:16:14 +0000
commitf514bec9a4ebeab16d11248ebacf8a9dfa74a9b1 (patch)
treec01d8de31082f9b698b449aeef5b5fd8ebd8024b /sys/dev/usb/usb.c
parent9bed276b3acd69e5f43f786ef8c4fc00f1eaa6f6 (diff)
This allows us to disable usb(4) without kernel crash.
ok mpi@
Diffstat (limited to 'sys/dev/usb/usb.c')
-rw-r--r--sys/dev/usb/usb.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/dev/usb/usb.c b/sys/dev/usb/usb.c
index b8943882d0a..12c57c85587 100644
--- a/sys/dev/usb/usb.c
+++ b/sys/dev/usb/usb.c
@@ -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 {