Source-Changes-HG archive

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

[src/trunk]: src/sys/netbt since rfcomm_attach_pcb may be called from (soft) ...



details:   https://anonhg.NetBSD.org/src/rev/03e339915cd0
branches:  trunk
changeset: 333794:03e339915cd0
user:      plunky <plunky%NetBSD.org@localhost>
date:      Sun Nov 16 21:34:27 2014 +0000

description:
since rfcomm_attach_pcb may be called from (soft) interrupt context
(for incoming connections), use kmem_intr_()

diffstat:

 sys/netbt/rfcomm_upper.c |  10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diffs (38 lines):

diff -r abafdfa7b934 -r 03e339915cd0 sys/netbt/rfcomm_upper.c
--- a/sys/netbt/rfcomm_upper.c  Sun Nov 16 20:37:35 2014 +0000
+++ b/sys/netbt/rfcomm_upper.c  Sun Nov 16 21:34:27 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rfcomm_upper.c,v 1.21 2014/08/08 03:05:45 rtr Exp $    */
+/*     $NetBSD: rfcomm_upper.c,v 1.22 2014/11/16 21:34:27 plunky Exp $ */
 
 /*-
  * Copyright (c) 2006 Itronix Inc.
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rfcomm_upper.c,v 1.21 2014/08/08 03:05:45 rtr Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rfcomm_upper.c,v 1.22 2014/11/16 21:34:27 plunky Exp $");
 
 #include <sys/param.h>
 #include <sys/kernel.h>
@@ -70,7 +70,9 @@
        KASSERT(proto != NULL);
        KASSERT(upper != NULL);
 
-       dlc = kmem_zalloc(sizeof(struct rfcomm_dlc), KM_SLEEP);
+       dlc = kmem_intr_zalloc(sizeof(struct rfcomm_dlc), KM_NOSLEEP);
+       if (dlc == NULL)
+               return ENOMEM;
 
        dlc->rd_state = RFCOMM_DLC_CLOSED;
        dlc->rd_mtu = rfcomm_mtu_default;
@@ -296,7 +298,7 @@
                dlc->rd_flags |= RFCOMM_DLC_DETACH;
        else {
                callout_destroy(&dlc->rd_timeout);
-               kmem_free(dlc, sizeof(*dlc));
+               kmem_intr_free(dlc, sizeof(*dlc));
        }
 }
 



Home | Main Index | Thread Index | Old Index