Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 27 Oct 2025 11:31:05 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: 364864ea91ab - main - snd_dummy: Round channel pointer after each write
Message-ID:  <202510271131.59RBV5Hb018640@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch main has been updated by christos:

URL: https://cgit.FreeBSD.org/src/commit/?id=364864ea91abbd8a9a79578168fa5d34e05200a7

commit 364864ea91abbd8a9a79578168fa5d34e05200a7
Author:     Christos Margiolis <christos@FreeBSD.org>
AuthorDate: 2025-10-27 11:30:29 +0000
Commit:     Christos Margiolis <christos@FreeBSD.org>
CommitDate: 2025-10-27 11:30:29 +0000

    snd_dummy: Round channel pointer after each write
    
    Otherwise we go out of bounds and keep incrementing endlessly.
    
    Sponsored by:   The FreeBSD Foundation
    MFC after:      4 days
    Differential Revision:  https://reviews.freebsd.org/D53337
---
 sys/dev/sound/dummy.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/sys/dev/sound/dummy.c b/sys/dev/sound/dummy.c
index 1f2d69708eec..39214a141bf9 100644
--- a/sys/dev/sound/dummy.c
+++ b/sys/dev/sound/dummy.c
@@ -104,9 +104,10 @@ dummy_chan_io(void *arg)
 		ch = &sc->chans[i];
 		if (!ch->run)
 			continue;
-		if (ch->dir == PCMDIR_PLAY)
+		if (ch->dir == PCMDIR_PLAY) {
 			ch->ptr += sndbuf_getblksz(ch->buf);
-		else
+			ch->ptr %= sndbuf_getsize(ch->buf);
+		} else
 			sndbuf_fillsilence(ch->buf);
 		snd_mtxunlock(sc->lock);
 		chn_intr(ch->chan);


home | help

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