summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvisa <visa@openbsd.org>2019-03-14 04:28:10 +0000
committervisa <visa@openbsd.org>2019-03-14 04:28:10 +0000
commitcafbef77ae3998aaae205254d1dbb9676bdcfecf (patch)
treebfa01a38360061fb804e9a652c1bb7dc4465ee13
parentremove unused keyword "virtual". (diff)
downloadwireguard-openbsd-cafbef77ae3998aaae205254d1dbb9676bdcfecf.tar.xz
wireguard-openbsd-cafbef77ae3998aaae205254d1dbb9676bdcfecf.zip
Use non-blocking allocation in dwc2_allocx() to make
the routine safe to use in soft interrupt context. This fixes an assertwaitok() panic reported by Abel Abraham Camarillo Ojeda. OK mpi@
-rw-r--r--sys/dev/usb/dwc2/dwc2.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/dev/usb/dwc2/dwc2.c b/sys/dev/usb/dwc2/dwc2.c
index 2fcb7d8e1c4..0e4d5517214 100644
--- a/sys/dev/usb/dwc2/dwc2.c
+++ b/sys/dev/usb/dwc2/dwc2.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dwc2.c,v 1.47 2019/03/11 17:50:09 mpi Exp $ */
+/* $OpenBSD: dwc2.c,v 1.48 2019/03/14 04:28:10 visa Exp $ */
/* $NetBSD: dwc2.c,v 1.32 2014/09/02 23:26:20 macallan Exp $ */
/*-
@@ -302,7 +302,11 @@ dwc2_allocx(struct usbd_bus *bus)
memset(dxfer, 0, sizeof(*dxfer));
dxfer->urb = dwc2_hcd_urb_alloc(sc->sc_hsotg,
- DWC2_MAXISOCPACKETS, GFP_KERNEL);
+ DWC2_MAXISOCPACKETS, GFP_ATOMIC);
+ if (dxfer->urb == NULL) {
+ pool_put(&sc->sc_xferpool, dxfer);
+ return NULL;
+ }
#ifdef DWC2_DEBUG
dxfer->xfer.busy_free = XFER_ONQU;