Module Name: src
Committed By: dyoung
Date: Mon Mar 22 17:12:09 UTC 2010
Modified Files:
src/sys/dev/ic: i82557.c
Log Message:
Check whether the fxp(4) actually attached before calling fxp_stop().
To generate a diff of this commit:
cvs rdiff -u -r1.133 -r1.134 src/sys/dev/ic/i82557.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/ic/i82557.c
diff -u src/sys/dev/ic/i82557.c:1.133 src/sys/dev/ic/i82557.c:1.134
--- src/sys/dev/ic/i82557.c:1.133 Mon Mar 22 16:11:58 2010
+++ src/sys/dev/ic/i82557.c Mon Mar 22 17:12:09 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: i82557.c,v 1.133 2010/03/22 16:11:58 dyoung Exp $ */
+/* $NetBSD: i82557.c,v 1.134 2010/03/22 17:12:09 dyoung Exp $ */
/*-
* Copyright (c) 1997, 1998, 1999, 2001, 2002 The NetBSD Foundation, Inc.
@@ -66,7 +66,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: i82557.c,v 1.133 2010/03/22 16:11:58 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: i82557.c,v 1.134 2010/03/22 17:12:09 dyoung Exp $");
#include "rnd.h"
@@ -2496,15 +2496,15 @@
struct ifnet *ifp = &sc->sc_ethercom.ec_if;
int i, s;
+ /* Succeed now if there's no work to do. */
+ if ((sc->sc_flags & FXPF_ATTACHED) == 0)
+ return (0);
+
s = splnet();
/* Stop the interface. Callouts are stopped in it. */
fxp_stop(ifp, 1);
splx(s);
- /* Succeed now if there's no work to do. */
- if ((sc->sc_flags & FXPF_ATTACHED) == 0)
- return (0);
-
/* Destroy our callout. */
callout_destroy(&sc->sc_callout);