Module Name: src
Committed By: plunky
Date: Sun Nov 16 21:34:27 UTC 2014
Modified Files:
src/sys/netbt: rfcomm_upper.c
Log Message:
since rfcomm_attach_pcb may be called from (soft) interrupt context
(for incoming connections), use kmem_intr_()
To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/netbt/rfcomm_upper.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/netbt/rfcomm_upper.c
diff -u src/sys/netbt/rfcomm_upper.c:1.21 src/sys/netbt/rfcomm_upper.c:1.22
--- src/sys/netbt/rfcomm_upper.c:1.21 Fri Aug 8 03:05:45 2014
+++ src/sys/netbt/rfcomm_upper.c Sun Nov 16 21:34:27 2014
@@ -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 @@ rfcomm_attach_pcb(struct rfcomm_dlc **ha
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 @@ rfcomm_detach_pcb(struct rfcomm_dlc **ha
dlc->rd_flags |= RFCOMM_DLC_DETACH;
else {
callout_destroy(&dlc->rd_timeout);
- kmem_free(dlc, sizeof(*dlc));
+ kmem_intr_free(dlc, sizeof(*dlc));
}
}