Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/usb Don't ignore detach errors from children.



details:   https://anonhg.NetBSD.org/src/rev/7819e929231c
branches:  trunk
changeset: 379636:7819e929231c
user:      mlelstv <mlelstv%NetBSD.org@localhost>
date:      Sun Jun 13 07:49:43 2021 +0000

description:
Don't ignore detach errors from children.

diffstat:

 sys/dev/usb/uaudio.c |  13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diffs (49 lines):

diff -r 53dd4e0c5113 -r 7819e929231c sys/dev/usb/uaudio.c
--- a/sys/dev/usb/uaudio.c      Sun Jun 13 03:09:20 2021 +0000
+++ b/sys/dev/usb/uaudio.c      Sun Jun 13 07:49:43 2021 +0000
@@ -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



Home | Main Index | Thread Index | Old Index