summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexandre Ratchov <ratchov@cvs.openbsd.org>2017-02-15 21:28:24 +0000
committerAlexandre Ratchov <ratchov@cvs.openbsd.org>2017-02-15 21:28:24 +0000
commite8a6fb3115cb495c1a943a38d2d79b31d25720ba (patch)
treee1e04629bf99c3ab8652288cff1750d5908ce20b
parent843ed68a8920cdce100eb18ca277e6e06ff7548f (diff)
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();