Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/usb Catch illegal memory allocations in softints.



details:   https://anonhg.NetBSD.org/src/rev/263f3ae5d16d
branches:  trunk
changeset: 325397:263f3ae5d16d
user:      mlelstv <mlelstv%NetBSD.org@localhost>
date:      Sun Dec 22 18:29:25 2013 +0000

description:
Catch illegal memory allocations in softints.

diffstat:

 sys/dev/usb/usb_mem.c |  10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diffs (45 lines):

diff -r bb4d94338f67 -r 263f3ae5d16d sys/dev/usb/usb_mem.c
--- a/sys/dev/usb/usb_mem.c     Sun Dec 22 18:20:46 2013 +0000
+++ b/sys/dev/usb/usb_mem.c     Sun Dec 22 18:29:25 2013 +0000
@@ -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 @@
        }
 
 #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 @@
        }
 
 #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 @@
 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;
        }



Home | Main Index | Thread Index | Old Index