Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 26 Jul 2022 19:33:31 GMT
From:      Marcin Wojtas <mw@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: b672b9ef77d7 - stable/12 - ena: Fix invalid KASSERT test in netmap code
Message-ID:  <202207261933.26QJXVFg033979@gitrepo.freebsd.org>

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

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

commit b672b9ef77d7e2a1f711ef16af3cf3d0b6f9ad26
Author:     Michal Krawczyk <mk@semihalf.com>
AuthorDate: 2022-06-10 09:18:13 +0000
Commit:     Marcin Wojtas <mw@FreeBSD.org>
CommitDate: 2022-07-26 19:33:04 +0000

    ena: Fix invalid KASSERT test in netmap code
    
    The KASSERT was originally added to ensure that the netmap Rx ring is
    not NULL, however, it was checking for the opposite.
    
    Obtained from: Semihalf
    MFC after: 2 weeks
    Sponsored by: Amazon, Inc.
    
    (cherry picked from commit 79770fdad6c18d968cc122c4294820931cc542e0)
---
 sys/dev/ena/ena_netmap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/dev/ena/ena_netmap.c b/sys/dev/ena/ena_netmap.c
index 6a780440efc9..228db0cb31ab 100644
--- a/sys/dev/ena/ena_netmap.c
+++ b/sys/dev/ena/ena_netmap.c
@@ -206,7 +206,7 @@ ena_netmap_free_rx_slot(struct ena_adapter *adapter, struct ena_ring *rx_ring,
 	    BUS_DMASYNC_POSTREAD);
 	netmap_unload_map(na, adapter->rx_buf_tag, rx_info->map);
 
-	KASSERT(kring->ring == NULL, ("Netmap Rx ring is NULL\n"));
+	KASSERT(kring->ring != NULL, ("Netmap Rx ring is NULL\n"));
 
 	slot = &kring->ring->slot[nm_i];
 



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