From 573c328527506964766811f8fd92c58542b53d4d Mon Sep 17 00:00:00 2001 From: Alexandre Ratchov Date: Wed, 15 Apr 2020 14:24:59 +0200 Subject: [PATCH] Don't forget to notify clients when a control is removed --- sndiod/dev.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sndiod/dev.c b/sndiod/dev.c index 9cb7330..4f691e2 100644 --- a/sndiod/dev.c +++ b/sndiod/dev.c @@ -2365,10 +2365,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