Module Name: src
Committed By: christos
Date: Thu Dec 2 16:56:22 UTC 2010
Modified Files:
src/sys/dev/usb: if_otus.c
Log Message:
Don't crash during detach if the attach hook failed before setting up.
>From Chuck Silvers
To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/usb/if_otus.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/usb/if_otus.c
diff -u src/sys/dev/usb/if_otus.c:1.7 src/sys/dev/usb/if_otus.c:1.8
--- src/sys/dev/usb/if_otus.c:1.7 Thu Nov 4 10:08:31 2010
+++ src/sys/dev/usb/if_otus.c Thu Dec 2 11:56:21 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: if_otus.c,v 1.7 2010/11/04 14:08:31 christos Exp $ */
+/* $NetBSD: if_otus.c,v 1.8 2010/12/02 16:56:21 christos Exp $ */
/* $OpenBSD: if_otus.c,v 1.18 2010/08/27 17:08:00 jsg Exp $ */
/*-
@@ -645,6 +645,9 @@
DPRINTF("otus_detach\n");
+ if (ifp == NULL) /* Failed to attach properly */
+ return 0;
+
otus_stop(ifp);
s = splnet();