From f436debf7b018aaec336928708f246acd20a9a35 Mon Sep 17 00:00:00 2001 From: mglocker Date: Sun, 5 Sep 2021 16:16:13 +0000 Subject: [PATCH] This allows us to disable usb(4) without kernel crash. ok mpi@ --- sys/dev/usb/usb.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 { -- 2.20.1