diff options
author | Gleb Smirnoff <glebius@FreeBSD.org> | 2004-12-19 14:58:13 +0000 |
---|---|---|
committer | Gleb Smirnoff <glebius@FreeBSD.org> | 2004-12-19 14:58:13 +0000 |
commit | d58e678f22a154e98f31668331008f6b5490ac67 (patch) | |
tree | 587c3ce46b10bc29ca4f37eb18dfd8cb5f379b70 /sys/netgraph | |
parent | 0993d1af0660e3b0541c3f0748a098d92e23b8de (diff) | |
download | src-d58e678f22a154e98f31668331008f6b5490ac67.tar.gz src-d58e678f22a154e98f31668331008f6b5490ac67.zip |
Assert queue mutex in ng_dequeue() and ng_queue_rw().
Notes
Notes:
svn path=/head/; revision=139039
Diffstat (limited to 'sys/netgraph')
-rw-r--r-- | sys/netgraph/ng_base.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/netgraph/ng_base.c b/sys/netgraph/ng_base.c index 9ba7b80d1f44..e0355bc5b8e1 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; /* |