diff options
| author | riastradh <riastradh@NetBSD.org> | 2022-08-23 01:08:04 +0000 |
|---|---|---|
| committer | riastradh <riastradh@NetBSD.org> | 2022-08-23 01:08:04 +0000 |
| commit | 79ff33a04fd54d08940d90871ffe7ff7d3a3eb24 (patch) | |
| tree | 76502a113dc2980cbcc1ced03a5ed850406ea02f /sys/dev/usb | |
| parent | 6d75fda3b77b28658231f45c366ab15e6871d837 (diff) | |
usbnet(9): Don't touch ifp->if_flags in usbnet_start_locked.
Instead, consult unp->unp_txstopped -- but the caller already
guarantees it is not stopped, so turn the conditional into an
assertion anyway.
Diffstat (limited to 'sys/dev/usb')
| -rw-r--r-- | sys/dev/usb/usbnet.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/sys/dev/usb/usbnet.c b/sys/dev/usb/usbnet.c index 3f6516a6ad8..d9e38b1d1bc 100644 --- a/sys/dev/usb/usbnet.c +++ b/sys/dev/usb/usbnet.c @@ -1,4 +1,4 @@ -/* $NetBSD: usbnet.c,v 1.109 2022/08/20 14:08:59 riastradh Exp $ */ +/* $NetBSD: usbnet.c,v 1.110 2022/08/23 01:08:04 riastradh Exp $ */ /* * Copyright (c) 2019 Matthew R. Green @@ -31,7 +31,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: usbnet.c,v 1.109 2022/08/20 14:08:59 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: usbnet.c,v 1.110 2022/08/23 01:08:04 riastradh Exp $"); #include <sys/param.h> #include <sys/kernel.h> @@ -503,10 +503,11 @@ usbnet_start_locked(struct ifnet *ifp) usbnet_isowned_tx(un); KASSERT(cd->uncd_tx_cnt <= un->un_tx_list_cnt); + KASSERT(!unp->unp_txstopped); - if (!unp->unp_link || (ifp->if_flags & IFF_RUNNING) == 0) { - DPRINTF("start called no link (%jx) or running (flags %jx)", - unp->unp_link, ifp->if_flags, 0, 0); + if (!unp->unp_link) { + DPRINTF("start called no link (%jx)", + unp->unp_link, 0, 0, 0); return; } |
