Add a KASSERT

This commit is contained in:
skrll 2019-01-22 06:42:33 +00:00
parent 137adc2b0b
commit c83dd31736
3 changed files with 9 additions and 6 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: uhci.c,v 1.284 2018/09/16 20:21:56 mrg Exp $ */
/* $NetBSD: uhci.c,v 1.285 2019/01/22 06:42:33 skrll Exp $ */
/*
* Copyright (c) 1998, 2004, 2011, 2012 The NetBSD Foundation, Inc.
@ -42,7 +42,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: uhci.c,v 1.284 2018/09/16 20:21:56 mrg Exp $");
__KERNEL_RCSID(0, "$NetBSD: uhci.c,v 1.285 2019/01/22 06:42:33 skrll Exp $");
#ifdef _KERNEL_OPT
#include "opt_usb.h"
@ -1740,6 +1740,7 @@ uhci_timeout_task(void *addr)
DPRINTF("xfer=%#jx", (uintptr_t)xfer, 0, 0, 0);
mutex_enter(&sc->sc_lock);
KASSERT(xfer->ux_status == USBD_TIMEOUT);
uhci_abort_xfer(xfer, USBD_TIMEOUT);
mutex_exit(&sc->sc_lock);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: xhci.c,v 1.103 2019/01/11 15:43:51 skrll Exp $ */
/* $NetBSD: xhci.c,v 1.104 2019/01/22 06:42:33 skrll Exp $ */
/*
* Copyright (c) 2013 Jonathan A. Kollasch
@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.103 2019/01/11 15:43:51 skrll Exp $");
__KERNEL_RCSID(0, "$NetBSD: xhci.c,v 1.104 2019/01/22 06:42:33 skrll Exp $");
#ifdef _KERNEL_OPT
#include "opt_usb.h"
@ -4180,6 +4180,7 @@ xhci_timeout_task(void *addr)
struct xhci_softc * const sc = XHCI_XFER2SC(xfer);
mutex_enter(&sc->sc_lock);
KASSERT(xfer->ux_status == USBD_TIMEOUT);
xhci_abort_xfer(xfer, USBD_TIMEOUT);
mutex_exit(&sc->sc_lock);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: dwc2.c,v 1.55 2018/09/16 20:21:56 mrg Exp $ */
/* $NetBSD: dwc2.c,v 1.56 2019/01/22 06:42:33 skrll Exp $ */
/*-
* Copyright (c) 2013 The NetBSD Foundation, Inc.
@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: dwc2.c,v 1.55 2018/09/16 20:21:56 mrg Exp $");
__KERNEL_RCSID(0, "$NetBSD: dwc2.c,v 1.56 2019/01/22 06:42:33 skrll Exp $");
#include "opt_usb.h"
@ -341,6 +341,7 @@ dwc2_timeout_task(void *addr)
DPRINTF("xfer=%p\n", xfer);
mutex_enter(&sc->sc_lock);
KASSERT(xfer->ux_status == USBD_TIMEOUT);
dwc2_abort_xfer(xfer, USBD_TIMEOUT);
mutex_exit(&sc->sc_lock);
}