Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 21 Sep 2022 14:00:58 GMT
From:      "Bjoern A. Zeeb" <bz@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: b6e6b7bc5d63 - stable/13 - arm/gic: fix a KASSERT in arm_gic_reserve_msi_range()
Message-ID:  <202209211400.28LE0w9e098137@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by bz:

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

commit b6e6b7bc5d6302a8b69c47590e647be6bd629fd7
Author:     Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2022-08-22 11:51:37 +0000
Commit:     Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2022-09-21 11:38:41 +0000

    arm/gic: fix a KASSERT in arm_gic_reserve_msi_range()
    
    Fix the off-by-one in the KASSERT in arm_gic_reserve_msi_range()
    allowing the MSIs being allocated at the end of the IRQ range.
    
    Reported by:    bz
    Submitted by:   andrew
    Reviewed by:    andrew
    Differential Revision: https://reviews.freebsd.org/D36291
    
    (cherry picked from commit 11d08e7e8d6ca4de0852b2998593a295b04cb567)
---
 sys/arm/arm/gic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/arm/arm/gic.c b/sys/arm/arm/gic.c
index 8fcf511fda08..0a6329edb472 100644
--- a/sys/arm/arm/gic.c
+++ b/sys/arm/arm/gic.c
@@ -279,7 +279,7 @@ arm_gic_reserve_msi_range(device_t dev, u_int start, u_int count)
 
 	sc = device_get_softc(dev);
 
-	KASSERT((start + count) < sc->nirqs,
+	KASSERT((start + count) <= sc->nirqs,
 	    ("%s: Trying to allocate too many MSI IRQs: %d + %d > %d", __func__,
 	    start, count, sc->nirqs));
 	for (i = 0; i < count; i++) {



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