summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMike Belopuhov <mikeb@cvs.openbsd.org>2015-06-04 17:10:34 +0000
committerMike Belopuhov <mikeb@cvs.openbsd.org>2015-06-04 17:10:34 +0000
commit0c007d0ec947fda36449422a9a7091174f3d0ca2 (patch)
treed98f4231abe39a1d44cf7941adcb44c90d6fd6e4 /sys
parentd22be6a0edaff63dca3fca1507303d08eccf60e1 (diff)
Check if interface was stopped before calling rx/tx interrupt routines.
Report & tests by mxb@alumni.chalmers.se, thanks! OK deraadt, chris
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/pci/if_vmx.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/sys/dev/pci/if_vmx.c b/sys/dev/pci/if_vmx.c
index 29738d5e1d2..0f1090b1c61 100644
--- a/sys/dev/pci/if_vmx.c
+++ b/sys/dev/pci/if_vmx.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_vmx.c,v 1.28 2015/05/29 00:37:10 uebayasi Exp $ */
+/* $OpenBSD: if_vmx.c,v 1.29 2015/06/04 17:10:33 mikeb Exp $ */
/*
* Copyright (c) 2013 Tsubai Masanari
@@ -590,17 +590,20 @@ int
vmxnet3_intr(void *arg)
{
struct vmxnet3_softc *sc = arg;
+ struct ifnet *ifp = &sc->sc_arpcom.ac_if;
if (READ_BAR1(sc, VMXNET3_BAR1_INTR) == 0)
return 0;
if (sc->sc_ds->event)
vmxnet3_evintr(sc);
- vmxnet3_rxintr(sc, &sc->sc_rxq[0]);
- vmxnet3_txintr(sc, &sc->sc_txq[0]);
#ifdef VMXNET3_STAT
vmxstat.intr++;
#endif
- vmxnet3_enable_intr(sc, 0);
+ if (ifp->if_flags & IFF_RUNNING) {
+ vmxnet3_rxintr(sc, &sc->sc_rxq[0]);
+ vmxnet3_txintr(sc, &sc->sc_txq[0]);
+ vmxnet3_enable_intr(sc, 0);
+ }
return 1;
}