git: 0c8147ae3bc1 - main - sound: Re-arrange a calculation in dsp_mmap_single()

From: Christos Margiolis <christos_at_FreeBSD.org>
Date: Sat, 20 Jun 2026 19:05:34 UTC
The branch main has been updated by christos:

URL: https://cgit.FreeBSD.org/src/commit/?id=0c8147ae3bc1c7db95098fcc92fc2e86111f59d3

commit 0c8147ae3bc1c7db95098fcc92fc2e86111f59d3
Author:     Christos Margiolis <christos@FreeBSD.org>
AuthorDate: 2026-06-12 06:14:57 +0000
Commit:     Christos Margiolis <christos@FreeBSD.org>
CommitDate: 2026-06-20 19:04:50 +0000

    sound: Re-arrange a calculation in dsp_mmap_single()
    
    This makes it easier to read. No functional change intended.
    
    Sponsored by:   The FreeBSD Foundation
    MFC after:      1 week
    Reviewed by:    markj, kib
    Pull-Request:   https://ron-dev.freebsd.org/FreeBSD/src/pulls/30
---
 sys/dev/sound/pcm/dsp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/dev/sound/pcm/dsp.c b/sys/dev/sound/pcm/dsp.c
index 337eb4e175b2..52c30f847f01 100644
--- a/sys/dev/sound/pcm/dsp.c
+++ b/sys/dev/sound/pcm/dsp.c
@@ -1993,7 +1993,7 @@ dsp_mmap_single(struct cdev *cdev, vm_ooffset_t *offset,
 
 	CHN_LOCK(c);
 	if ((c->flags & CHN_F_MMAP_INVALID) ||
-	    *offset + size > c->bufsoft->allocsize) {
+	    c->bufsoft->allocsize < *offset + size) {
 		CHN_UNLOCK(c);
 		PCM_GIANT_EXIT(d);
 		return (EINVAL);