Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/isa Convert an open-coded check for M_PKTHDR + panic...



details:   https://anonhg.NetBSD.org/src/rev/3943504986d9
branches:  trunk
changeset: 370108:3943504986d9
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Sat Sep 17 16:54:01 2022 +0000

description:
Convert an open-coded check for M_PKTHDR + panic into a KASSERT().

diffstat:

 sys/dev/isa/if_eg.c |  9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)

diffs (30 lines):

diff -r 9cab034df442 -r 3943504986d9 sys/dev/isa/if_eg.c
--- a/sys/dev/isa/if_eg.c       Sat Sep 17 16:52:26 2022 +0000
+++ b/sys/dev/isa/if_eg.c       Sat Sep 17 16:54:01 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_eg.c,v 1.101 2022/09/17 16:52:26 thorpej Exp $      */
+/*     $NetBSD: if_eg.c,v 1.102 2022/09/17 16:54:01 thorpej Exp $      */
 
 /*
  * Copyright (c) 1993 Dean Huxley <dean%fsa.ca@localhost>
@@ -40,7 +40,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_eg.c,v 1.101 2022/09/17 16:52:26 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_eg.c,v 1.102 2022/09/17 16:54:01 thorpej Exp $");
 
 #include "opt_inet.h"
 
@@ -575,10 +575,7 @@
        sc->eg_txbusy = true;
 
        /* We need to use m->m_pkthdr.len, so require the header */
-       if ((m0->m_flags & M_PKTHDR) == 0) {
-               aprint_error_dev(sc->sc_dev, "no header mbuf\n");
-               panic("egstart");
-       }
+       KASSERT(m0->m_flags & M_PKTHDR);
        len = uimax(m0->m_pkthdr.len, ETHER_MIN_LEN - ETHER_CRC_LEN);
 
        bpf_mtap(ifp, m0, BPF_D_OUT);



Home | Main Index | Thread Index | Old Index