diff options
| author | mlelstv <mlelstv@NetBSD.org> | 2013-12-22 18:29:25 +0000 |
|---|---|---|
| committer | mlelstv <mlelstv@NetBSD.org> | 2013-12-22 18:29:25 +0000 |
| commit | ec0655772679127e34b95754ed74b73a2767dc2f (patch) | |
| tree | cf94ae6f0f533e53a41b5a2c01f14fd676118e61 /sys/dev | |
| parent | d9a30cdd5fdff00d4f9be99b858474852ad84354 (diff) | |
Catch illegal memory allocations in softints.
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/usb/usb_mem.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/dev/usb/usb_mem.c b/sys/dev/usb/usb_mem.c index 5ac0dfcf18d..812a1f2707d 100644 --- a/sys/dev/usb/usb_mem.c +++ b/sys/dev/usb/usb_mem.c @@ -1,4 +1,4 @@ -/* $NetBSD: usb_mem.c,v 1.63 2013/09/15 15:47:27 martin Exp $ */ +/* $NetBSD: usb_mem.c,v 1.64 2013/12/22 18:29:25 mlelstv Exp $ */ /* * Copyright (c) 1998 The NetBSD Foundation, Inc. @@ -38,7 +38,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: usb_mem.c,v 1.63 2013/09/15 15:47:27 martin Exp $"); +__KERNEL_RCSID(0, "$NetBSD: usb_mem.c,v 1.64 2013/12/22 18:29:25 mlelstv Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -128,7 +128,7 @@ usb_block_allocmem(bus_dma_tag_t tag, size_t size, size_t align, } #ifdef DIAGNOSTIC - if (cpu_intr_p()) { + if (cpu_softintr_p() || cpu_intr_p()) { printf("usb_block_allocmem: in interrupt context, size=%lu\n", (unsigned long) size); } @@ -152,7 +152,7 @@ usb_block_allocmem(bus_dma_tag_t tag, size_t size, size_t align, } #ifdef DIAGNOSTIC - if (cpu_intr_p()) { + if (cpu_softintr_p() || cpu_intr_p()) { printf("usb_block_allocmem: in interrupt context, failed\n"); return (USBD_NOMEM); } @@ -225,7 +225,7 @@ void usb_block_real_freemem(usb_dma_block_t *b) { #ifdef DIAGNOSTIC - if (cpu_intr_p()) { + if (cpu_softintr_p() || cpu_intr_p()) { printf("usb_block_real_freemem: in interrupt context\n"); return; } |
