Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 25 Feb 2025 11:48:10 GMT
From:      Christos Margiolis <christos@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 405b1e50926d - main - sound: Do not fail from vchan_destroy() if children list is empty
Message-ID:  <202502251148.51PBmAve050763@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by christos:

URL: https://cgit.FreeBSD.org/src/commit/?id=405b1e50926d4162fb9503644073c0184a8b37d9

commit 405b1e50926d4162fb9503644073c0184a8b37d9
Author:     Christos Margiolis <christos@FreeBSD.org>
AuthorDate: 2025-02-25 11:43:11 +0000
Commit:     Christos Margiolis <christos@FreeBSD.org>
CommitDate: 2025-02-25 11:43:11 +0000

    sound: Do not fail from vchan_destroy() if children list is empty
    
    vchan_destroy() should be able to call chn_kill() regardless of whether
    the channel has been added to the children list yet or not. Also remove
    the CHN_F_BUSY check. There is no reason we shouldn't execute the code
    below if the parent is not busy.
    
    Sponsored by:   The FreeBSD Foundation
    MFC after:      1 week
    Reviewed by:    dev_submerge.ch
    Differential Revision:  https://reviews.freebsd.org/D48185
---
 sys/dev/sound/pcm/vchan.c | 7 -------
 1 file changed, 7 deletions(-)

diff --git a/sys/dev/sound/pcm/vchan.c b/sys/dev/sound/pcm/vchan.c
index 4165d0712b94..ea8a50b316fe 100644
--- a/sys/dev/sound/pcm/vchan.c
+++ b/sys/dev/sound/pcm/vchan.c
@@ -838,15 +838,8 @@ vchan_destroy(struct pcm_channel *c)
 
 	CHN_UNLOCK(c);
 
-	if (!(parent->flags & CHN_F_BUSY))
-		return (EBUSY);
-
-	if (CHN_EMPTY(parent, children))
-		return (EINVAL);
-
 	/* remove us from our parent's children list */
 	CHN_REMOVE(parent, c, children);
-
 	if (CHN_EMPTY(parent, children)) {
 		parent->flags &= ~(CHN_F_BUSY | CHN_F_HAS_VCHAN);
 		chn_reset(parent, parent->format, parent->speed);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202502251148.51PBmAve050763>