Module Name: src Committed By: cegger Date: Thu Aug 26 08:56:16 UTC 2010
Modified Files: src/sys/dev/ieee1394: firewire.c Log Message: fix crash when detaching/re-attaching a cable where three firewire devices are on the bus. To generate a diff of this commit: cvs rdiff -u -r1.36 -r1.37 src/sys/dev/ieee1394/firewire.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/ieee1394/firewire.c diff -u src/sys/dev/ieee1394/firewire.c:1.36 src/sys/dev/ieee1394/firewire.c:1.37 --- src/sys/dev/ieee1394/firewire.c:1.36 Sat Aug 14 18:28:59 2010 +++ src/sys/dev/ieee1394/firewire.c Thu Aug 26 08:56:15 2010 @@ -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");