summaryrefslogtreecommitdiffstats
path: root/sys/netgraph
diff options
context:
space:
mode:
authorglebius <glebius@FreeBSD.org>2004-12-19 14:58:13 +0000
committerglebius <glebius@FreeBSD.org>2004-12-19 14:58:13 +0000
commita7bbad17b9591f96b268dbb2dadf9f66777fbb77 (patch)
tree587c3ce46b10bc29ca4f37eb18dfd8cb5f379b70 /sys/netgraph
parent141ff18dcf7bddf238750827d895837406b2b3e4 (diff)
downloadFreeBSD-src-a7bbad17b9591f96b268dbb2dadf9f66777fbb77.zip
FreeBSD-src-a7bbad17b9591f96b268dbb2dadf9f66777fbb77.tar.gz
Assert queue mutex in ng_dequeue() and ng_queue_rw().
Diffstat (limited to 'sys/netgraph')
-rw-r--r--sys/netgraph/ng_base.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/netgraph/ng_base.c b/sys/netgraph/ng_base.c
index 9ba7b80..e0355bc 100644
--- a/sys/netgraph/ng_base.c
+++ b/sys/netgraph/ng_base.c
@@ -1777,6 +1777,8 @@ ng_dequeue(struct ng_queue *ngq)
item_p item;
u_int add_arg;
+ mtx_assert(&ngq->q_mtx, MA_OWNED);
+
if (CAN_GET_READ(ngq->q_flags)) {
/*
* Head of queue is a reader and we have no write active.
@@ -1903,6 +1905,8 @@ ng_dequeue(struct ng_queue *ngq)
static __inline void
ng_queue_rw(struct ng_queue * ngq, item_p item, int rw)
{
+ mtx_assert(&ngq->q_mtx, MA_OWNED);
+
item->el_next = NULL; /* maybe not needed */
*ngq->last = item;
/*
OpenPOWER on IntegriCloud