From 181d24f54557c4fa9ae4505c28a9c911cb7f2e97 Mon Sep 17 00:00:00 2001 From: Jonathan Matthew Date: Wed, 7 Mar 2018 04:39:55 +0000 Subject: Replace non-functioning checks for use of the usb memory block allocator in interrupt context with assertwaitok(), which does work. ok dlg@ --- sys/dev/usb/usb_mem.c | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) (limited to 'sys') diff --git a/sys/dev/usb/usb_mem.c b/sys/dev/usb/usb_mem.c index 0ebb4d662ae..db0ea088a24 100644 --- a/sys/dev/usb/usb_mem.c +++ b/sys/dev/usb/usb_mem.c @@ -1,4 +1,4 @@ -/* $OpenBSD: usb_mem.c,v 1.29 2017/04/08 02:57:25 deraadt Exp $ */ +/* $OpenBSD: usb_mem.c,v 1.30 2018/03/07 04:39:54 jmatthew Exp $ */ /* $NetBSD: usb_mem.c,v 1.26 2003/02/01 06:23:40 thorpej Exp $ */ /* @@ -108,12 +108,7 @@ usb_block_allocmem(bus_dma_tag_t tag, size_t size, size_t align, } splx(s); -#ifdef DIAGNOSTIC - if (!curproc) { - printf("usb_block_allocmem: in interrupt context, failed\n"); - return (USBD_NOMEM); - } -#endif + assertwaitok(); DPRINTFN(6, ("usb_block_allocmem: no free\n")); p = malloc(sizeof *p, M_USB, M_NOWAIT); @@ -162,12 +157,7 @@ free0: void usb_block_real_freemem(struct usb_dma_block *p) { -#ifdef DIAGNOSTIC - if (!curproc) { - printf("usb_block_real_freemem: in interrupt context\n"); - return; - } -#endif + assertwaitok(); bus_dmamap_unload(p->tag, p->map); bus_dmamap_destroy(p->tag, p->map); bus_dmamem_unmap(p->tag, p->kaddr, p->size); -- cgit v1.2.3