Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/usb Avoid panic while detaching xhci. The xhci drive...



details:   https://anonhg.NetBSD.org/src/rev/c120905d1b12
branches:  trunk
changeset: 359115:c120905d1b12
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Tue Jan 30 08:53:39 2018 +0000

description:
Avoid panic while detaching xhci. The xhci driver has both sc_child and
sc_child2 but xhci_childdet() only supported sc_child. OK'd by Nick.

diffstat:

 sys/dev/usb/xhci.c |  10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diffs (31 lines):

diff -r c51737c34ff4 -r c120905d1b12 sys/dev/usb/xhci.c
--- a/sys/dev/usb/xhci.c        Tue Jan 30 08:15:47 2018 +0000
+++ b/sys/dev/usb/xhci.c        Tue Jan 30 08:53:39 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: xhci.c,v 1.83 2017/12/20 08:21:11 skrll Exp $  */
+/*     $NetBSD: xhci.c,v 1.84 2018/01/30 08:53:39 msaitoh Exp $        */
 
 /*
  * Copyright (c) 2013 Jonathan A. Kollasch
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.83 2017/12/20 08:21:11 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.84 2018/01/30 08:53:39 msaitoh Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -577,8 +577,10 @@
 {
        struct xhci_softc * const sc = device_private(self);
 
-       KASSERT(sc->sc_child == child);
-       if (child == sc->sc_child)
+       KASSERT((sc->sc_child == child) || (sc->sc_child2 == child));
+       if (child == sc->sc_child2)
+               sc->sc_child2 = NULL;
+       else if (child == sc->sc_child)
                sc->sc_child = NULL;
 }
 



Home | Main Index | Thread Index | Old Index