sndiod: Fix confusion between the slot and ctlslot pointers
authorratchov <ratchov@openbsd.org>
Tue, 2 Apr 2024 05:21:32 +0000 (05:21 +0000)
committerratchov <ratchov@openbsd.org>
Tue, 2 Apr 2024 05:21:32 +0000 (05:21 +0000)
Fixes crash when the device is disconnected and the clients are not
migrated to another device.

usr.bin/sndiod/dev.c

index bd0ed8d..235b6d5 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: dev.c,v 1.107 2023/12/09 22:12:03 ratchov Exp $       */
+/*     $OpenBSD: dev.c,v 1.108 2024/04/02 05:21:32 ratchov Exp $       */
 /*
  * Copyright (c) 2008-2012 Alexandre Ratchov <alex@caoua.org>
  *
@@ -1108,7 +1108,7 @@ dev_abort(struct dev *d)
                        if (c->ops == NULL)
                                continue;
                        if (c->opt == o) {
-                               c->ops->exit(s->arg);
+                               c->ops->exit(c->arg);
                                c->ops = NULL;
                        }
                }