From c884a1dc23c079b7a2c961b98b9a56dd4ed2c541 Mon Sep 17 00:00:00 2001 From: Poul-Henning Kamp Date: Thu, 6 Jan 2005 23:13:50 +0000 Subject: [PATCH] Close a theoretical race: By the time the watchdog comes around the interface may have been stopped, so we should not restart it. --- sys/pci/if_sis.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/pci/if_sis.c b/sys/pci/if_sis.c index a933173b2587..e257db3510f9 100644 --- a/sys/pci/if_sis.c +++ b/sys/pci/if_sis.c @@ -2235,11 +2235,15 @@ sis_ioctl(struct ifnet *ifp, u_long command, caddr_t data) static void sis_watchdog(struct ifnet *ifp) { - struct sis_softc *sc; + struct sis_softc *sc; sc = ifp->if_softc; SIS_LOCK(sc); + if (sc->sis_stopped) { + SIS_UNLOCK(sc); + return; + } ifp->if_oerrors++; printf("sis%d: watchdog timeout\n", sc->sis_unit);