Source-Changes-HG archive

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

[src-draft/trunk]: src/sys/dev/usb Fix rx_mtx locking botch.



details:   https://anonhg.NetBSD.org/src-all/rev/fae3b60ee5a0
branches:  trunk
changeset: 987688:fae3b60ee5a0
user:      Nathanial Sloss <nat%netbsd.org@localhost>
date:      Sat Aug 15 19:47:21 2020 +1000

description:
Fix rx_mtx locking botch.

diffstat:

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

diffs (23 lines):

diff -r 6043151fc5d8 -r fae3b60ee5a0 sys/dev/usb/if_urtwn.c
--- a/sys/dev/usb/if_urtwn.c    Sat Aug 15 19:46:38 2020 +1000
+++ b/sys/dev/usb/if_urtwn.c    Sat Aug 15 19:47:21 2020 +1000
@@ -623,7 +623,7 @@
                        error = usbd_transfer(data->xfer);
                        if (__predict_false(error != USBD_NORMAL_COMPLETION &&
                            error != USBD_IN_PROGRESS))
-                               goto fail;
+                               goto fail_1;
                }
                mutex_exit(&sc->sc_rx_mtx);
        }
@@ -631,7 +631,9 @@
 
        return;
 
- fail:
+fail_1:
+       mutex_exit(&sc->sc_rx_mtx);
+fail:
        sc->sc_dying = 1;
        mutex_exit(&sc->sc_write_mtx);
        aprint_error_dev(self, "attach failed\n");



Home | Main Index | Thread Index | Old Index