diff options
| author | tsutsui <tsutsui@NetBSD.org> | 2007-06-12 14:32:36 +0000 |
|---|---|---|
| committer | tsutsui <tsutsui@NetBSD.org> | 2007-06-12 14:32:36 +0000 |
| commit | 7be92697913e9b40468017c1426eefac27bb1a00 (patch) | |
| tree | 32e90f6a351c9a603e4d3dcbbcc40641cfb43e91 /sys/dev | |
| parent | c6ee19e6af7cfa576a6815d3a09d17c2a2b80877 (diff) | |
Fix one more bug I introduced in rev 1.21:
Clear sc->sc_rx_consumed before allocating RX mbufs by vge_newbuf()
in vge_intr() otherwise vge_newbuf() might get KASSERT() failure
on DIAGNOSTIC kernel when the interface is reinitialized during RX.
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/pci/if_vge.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/pci/if_vge.c b/sys/dev/pci/if_vge.c index cee13a0bf62..835ab3e67e3 100644 --- a/sys/dev/pci/if_vge.c +++ b/sys/dev/pci/if_vge.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_vge.c,v 1.34 2007/03/04 06:02:23 christos Exp $ */ +/* $NetBSD: if_vge.c,v 1.35 2007/06/12 14:32:36 tsutsui Exp $ */ /*- * Copyright (c) 2004 @@ -35,7 +35,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: if_vge.c,v 1.34 2007/03/04 06:02:23 christos Exp $"); +__KERNEL_RCSID(0, "$NetBSD: if_vge.c,v 1.35 2007/06/12 14:32:36 tsutsui Exp $"); /* * VIA Networking Technologies VT612x PCI gigabit ethernet NIC driver. @@ -1793,6 +1793,7 @@ vge_init(struct ifnet *ifp) /* Initialize the RX descriptors and mbufs. */ memset(sc->sc_rxdescs, 0, sizeof(sc->sc_rxdescs)); + sc->sc_rx_consumed = 0; for (i = 0; i < VGE_NRXDESC; i++) { if (vge_newbuf(sc, i, NULL) == ENOBUFS) { aprint_error("%s: unable to allocate or map " @@ -1801,7 +1802,6 @@ vge_init(struct ifnet *ifp) } } sc->sc_rx_prodidx = 0; - sc->sc_rx_consumed = 0; sc->sc_rx_mhead = sc->sc_rx_mtail = NULL; /* Initialize the TX descriptors and mbufs. */ |
