Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/usb also reset xs->xs_xr[dci] to NULL when closing t...



details:   https://anonhg.NetBSD.org/src/rev/ca755af8f7bb
branches:  trunk
changeset: 379561:ca755af8f7bb
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Sun Jun 06 18:37:20 2021 +0000

description:
also reset xs->xs_xr[dci] to NULL when closing the pipe

avoids KASSERT() on next xhci_open()

should fix PR kern/56194 by nia

diffstat:

 sys/dev/usb/xhci.c |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (26 lines):

diff -r c54bf698bd2b -r ca755af8f7bb sys/dev/usb/xhci.c
--- a/sys/dev/usb/xhci.c        Sun Jun 06 13:59:48 2021 +0000
+++ b/sys/dev/usb/xhci.c        Sun Jun 06 18:37:20 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: xhci.c,v 1.143 2021/05/29 16:49:30 riastradh Exp $     */
+/*     $NetBSD: xhci.c,v 1.144 2021/06/06 18:37:20 jdolecek Exp $      */
 
 /*
  * Copyright (c) 2013 Jonathan A. Kollasch
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.143 2021/05/29 16:49:30 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.144 2021/06/06 18:37:20 jdolecek Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_usb.h"
@@ -2159,6 +2159,7 @@ xhci_close_pipe(struct usbd_pipe *pipe)
        usb_syncmem(&xs->xs_dc_dma, 0, sc->sc_pgsz, BUS_DMASYNC_POSTREAD);
 
        xhci_ring_free(sc, &xs->xs_xr[dci]);
+       xs->xs_xr[dci] = NULL;
 }
 
 /*



Home | Main Index | Thread Index | Old Index