diff options
| author | 2013-04-10 12:58:52 +0000 | |
|---|---|---|
| committer | 2013-04-10 12:58:52 +0000 | |
| commit | 072148ed8353b5a030f76cbb85dbeae9b2840665 (patch) | |
| tree | af48a384ff72c7872943747b3e09cad838fc5cee /sys/compat/linux/linux_futex.c | |
| parent | Set EV_WRITE for jobs or run/if-shell jobs can hang. From Chris Johnsen. (diff) | |
| download | wireguard-openbsd-072148ed8353b5a030f76cbb85dbeae9b2840665.tar.xz wireguard-openbsd-072148ed8353b5a030f76cbb85dbeae9b2840665.zip | |
futex: Assert that the refcount is larger than 0 when doing futex_put.
Diffstat (limited to 'sys/compat/linux/linux_futex.c')
| -rw-r--r-- | sys/compat/linux/linux_futex.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/compat/linux/linux_futex.c b/sys/compat/linux/linux_futex.c index 04a37c51eaf..8442c6b63ef 100644 --- a/sys/compat/linux/linux_futex.c +++ b/sys/compat/linux/linux_futex.c @@ -1,4 +1,4 @@ -/* $OpenBSD: linux_futex.c,v 1.11 2013/01/15 10:47:35 guenther Exp $ */ +/* $OpenBSD: linux_futex.c,v 1.12 2013/04/10 12:58:52 pirofti Exp $ */ /* $NetBSD: linux_futex.c,v 1.26 2010/07/07 01:30:35 chs Exp $ */ /*- @@ -474,6 +474,7 @@ void futex_put(struct futex *f) { MUTEX_ASSERT_LOCKED(&futex_lock); + KASSERT(f->f_refcount > 0); f->f_refcount--; if (f->f_refcount == 0) { KASSERT(TAILQ_EMPTY(&f->f_waiting_proc)); |
