diff options
author | Alexandre Ratchov <ratchov@cvs.openbsd.org> | 2020-04-15 14:22:30 +0000 |
---|---|---|
committer | Alexandre Ratchov <ratchov@cvs.openbsd.org> | 2020-04-15 14:22:30 +0000 |
commit | dd10093abec808e5d6a20be4194a27aac6030d2d (patch) | |
tree | d552e9b94572a6c265fcee58a5472715f34a4f6a /usr.bin/sndiod/dev.c | |
parent | 5a2fca3d54be7cb6641798c3ab15f6dd9fb40f2c (diff) |
Don't forget to notify clients when a control is removed
Diffstat (limited to 'usr.bin/sndiod/dev.c')
-rw-r--r-- | usr.bin/sndiod/dev.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/usr.bin/sndiod/dev.c b/usr.bin/sndiod/dev.c index 9e8c661ee22..0f97a3ddcfb 100644 --- a/usr.bin/sndiod/dev.c +++ b/usr.bin/sndiod/dev.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dev.c,v 1.67 2020/04/15 14:21:35 ratchov Exp $ */ +/* $OpenBSD: dev.c,v 1.68 2020/04/15 14:22:29 ratchov Exp $ */ /* * Copyright (c) 2008-2012 Alexandre Ratchov <alex@caoua.org> * @@ -2330,10 +2330,12 @@ dev_rmctl(struct dev *d, int addr) } #endif c->refs_mask &= ~CTL_DEVMASK; - if (c->refs_mask != 0) + if (c->refs_mask == 0) { + *pc = c->next; + xfree(c); return; - *pc = c->next; - xfree(c); + } + c->desc_mask = ~0; } void |