Module Name: src
Committed By: mlelstv
Date: Sun Jun 13 07:49:43 UTC 2021
Modified Files:
src/sys/dev/usb: uaudio.c
Log Message:
Don't ignore detach errors from children.
To generate a diff of this commit:
cvs rdiff -u -r1.169 -r1.170 src/sys/dev/usb/uaudio.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/usb/uaudio.c
diff -u src/sys/dev/usb/uaudio.c:1.169 src/sys/dev/usb/uaudio.c:1.170
--- src/sys/dev/usb/uaudio.c:1.169 Mon Feb 15 13:39:18 2021
+++ src/sys/dev/usb/uaudio.c Sun Jun 13 07:49:43 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: uaudio.c,v 1.169 2021/02/15 13:39:18 isaki Exp $ */
+/* $NetBSD: uaudio.c,v 1.170 2021/06/13 07:49:43 mlelstv Exp $ */
/*
* Copyright (c) 1999, 2012 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uaudio.c,v 1.169 2021/02/15 13:39:18 isaki Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uaudio.c,v 1.170 2021/06/13 07:49:43 mlelstv Exp $");
#ifdef _KERNEL_OPT
#include "opt_usb.h"
@@ -519,7 +519,7 @@ static int
uaudio_detach(device_t self, int flags)
{
struct uaudio_softc *sc = device_private(self);
- int rv = 0;
+ int rv;
sc->sc_dying = 1;
@@ -529,8 +529,11 @@ uaudio_detach(device_t self, int flags)
uaudio_halt_out_dma_unlocked(sc);
uaudio_halt_in_dma_unlocked(sc);
- if (sc->sc_audiodev != NULL)
+ if (sc->sc_audiodev != NULL) {
rv = config_detach(sc->sc_audiodev, flags);
+ if (rv)
+ return rv;
+ }
usbd_add_drv_event(USB_EVENT_DRIVER_DETACH, sc->sc_udev, sc->sc_dev);
@@ -541,7 +544,7 @@ uaudio_detach(device_t self, int flags)
mutex_destroy(&sc->sc_lock);
mutex_destroy(&sc->sc_intr_lock);
- return rv;
+ return 0;
}
Static int