Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/ieee1394 fix crash when detaching/re-attaching a cab...



details:   https://anonhg.NetBSD.org/src/rev/b38a999e85b9
branches:  trunk
changeset: 757347:b38a999e85b9
user:      cegger <cegger%NetBSD.org@localhost>
date:      Thu Aug 26 08:56:15 2010 +0000

description:
fix crash when detaching/re-attaching a cable where three firewire devices are on the bus.

diffstat:

 sys/dev/ieee1394/firewire.c |  8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diffs (29 lines):

diff -r 91b330e2128d -r b38a999e85b9 sys/dev/ieee1394/firewire.c
--- a/sys/dev/ieee1394/firewire.c       Thu Aug 26 08:19:18 2010 +0000
+++ b/sys/dev/ieee1394/firewire.c       Thu Aug 26 08:56:15 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: firewire.c,v 1.36 2010/08/14 18:28:59 jym Exp $        */
+/*     $NetBSD: firewire.c,v 1.37 2010/08/26 08:56:15 cegger Exp $     */
 /*-
  * Copyright (c) 2003 Hidetoshi Shimokawa
  * Copyright (c) 1998-2002 Katsushi Kobayashi and Hidetoshi Shimokawa
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: firewire.c,v 1.36 2010/08/14 18:28:59 jym Exp $");
+__KERNEL_RCSID(0, "$NetBSD: firewire.c,v 1.37 2010/08/26 08:56:15 cegger Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -2053,6 +2053,10 @@
                        SLIST_FOREACH(devlist, &sc->devlist, link)
                                if (devlist->fwdev == fwdev)
                                        break;
+
+                       if (devlist == NULL)
+                               continue;
+
                        if (devlist->fwdev != fwdev)
                                panic("already detached");
 



Home | Main Index | Thread Index | Old Index