summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorratchov <ratchov@openbsd.org>2017-02-15 21:28:23 +0000
committerratchov <ratchov@openbsd.org>2017-02-15 21:28:23 +0000
commit2b204a4b4555840209afff14ff4be26f74028389 (patch)
treedeeca86a1f1ddcc70a0df366b08074c4458db205
parentgcc4 on m88k still uses sjlj exceptions, as did arm before EABI. (diff)
downloadwireguard-openbsd-2b204a4b4555840209afff14ff4be26f74028389.tar.xz
wireguard-openbsd-2b204a4b4555840209afff14ff4be26f74028389.zip
Fix the code supposed to abort when attempting to detach a slot that's
not on the slot list (the check was a no-op). Found by jsg@, thanks!
-rw-r--r--usr.bin/sndiod/dev.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/sndiod/dev.c b/usr.bin/sndiod/dev.c
index eae2a8a50ba..8adca3c1c02 100644
--- a/usr.bin/sndiod/dev.c
+++ b/usr.bin/sndiod/dev.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dev.c,v 1.27 2017/01/03 06:53:20 ratchov Exp $ */
+/* $OpenBSD: dev.c,v 1.28 2017/02/15 21:28:23 ratchov Exp $ */
/*
* Copyright (c) 2008-2012 Alexandre Ratchov <alex@caoua.org>
*
@@ -1823,7 +1823,7 @@ slot_detach(struct slot *s)
#endif
for (ps = &s->dev->slot_list; *ps != s; ps = &(*ps)->next) {
#ifdef DEBUG
- if (s == NULL) {
+ if (*ps == NULL) {
slot_log(s);
log_puts(": can't detach, not on list\n");
panic();