Date: Wed, 14 May 2025 14:24:07 GMT From: Christos Margiolis <christos@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: aff92a9f3c6c - releng/14.3 - sound: Call PCM_RELEASE() if pcm_addchan() fails Message-ID: <202505141424.54EEO7w7060372@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch releng/14.3 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=aff92a9f3c6c4c363188b667ae046d4789a5a63b commit aff92a9f3c6c4c363188b667ae046d4789a5a63b Author: Christos Margiolis <christos@FreeBSD.org> AuthorDate: 2025-05-13 22:02:41 +0000 Commit: Christos Margiolis <christos@FreeBSD.org> CommitDate: 2025-05-14 14:23:53 +0000 sound: Call PCM_RELEASE() if pcm_addchan() fails Fixes: fd906e47b18f ("sound: Simplify locking during device creation") Sponsored by: The FreeBSD Foundation MFC after: 1 day Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D50337 (cherry picked from commit dbfe79bbe5d5ebe296fbff2d101e0994d7881d0d) (cherry picked from commit 3de66f369c1e8db46ae938d446a72f6ff3493356) Approved by: re (cperciva) --- sys/dev/sound/pcm/sound.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/dev/sound/pcm/sound.c b/sys/dev/sound/pcm/sound.c index 794e1586b511..cfac8f73990d 100644 --- a/sys/dev/sound/pcm/sound.c +++ b/sys/dev/sound/pcm/sound.c @@ -139,6 +139,7 @@ pcm_addchan(device_t dev, int dir, kobj_class_t cls, void *devinfo) { struct snddev_info *d = device_get_softc(dev); struct pcm_channel *ch; + int err = 0; PCM_LOCK(d); PCM_WAIT(d); @@ -147,13 +148,12 @@ pcm_addchan(device_t dev, int dir, kobj_class_t cls, void *devinfo) if (!ch) { device_printf(d->dev, "chn_init(%s, %d, %p) failed\n", cls->name, dir, devinfo); - PCM_UNLOCK(d); - return (ENODEV); + err = ENODEV; } PCM_RELEASE(d); PCM_UNLOCK(d); - return (0); + return (err); } static void
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202505141424.54EEO7w7060372>