From f9f2d8353eb1414d97cf64e691b99de098614150 Mon Sep 17 00:00:00 2001 From: Alexandre Ratchov Date: Wed, 15 Feb 2017 11:58:54 +0100 Subject: [PATCH] Fix the code to abort when trying to detach a slot that's not on the list (the check was a no-op). Found by jsg@, thanks. --- sndiod/dev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sndiod/dev.c b/sndiod/dev.c index 494f074..ef85a83 100644 --- a/sndiod/dev.c +++ b/sndiod/dev.c @@ -1824,7 +1824,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();