aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPoul-Henning Kamp <phk@FreeBSD.org>2005-01-06 23:13:50 +0000
committerPoul-Henning Kamp <phk@FreeBSD.org>2005-01-06 23:13:50 +0000
commitc884a1dc23c079b7a2c961b98b9a56dd4ed2c541 (patch)
tree8f49a824b9cdddbb96902a1f2ea00ac84e365361
parent86cb007f9f53a618310e56ff967339221197b416 (diff)
downloadsrc-c884a1dc23c079b7a2c961b98b9a56dd4ed2c541.tar.gz
src-c884a1dc23c079b7a2c961b98b9a56dd4ed2c541.zip
Close a theoretical race: By the time the watchdog comes around
the interface may have been stopped, so we should not restart it.
Notes
Notes: svn path=/head/; revision=139797
-rw-r--r--sys/pci/if_sis.c6
1 files changed, 5 insertions, 1 deletions
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);