Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/usb usbnet(9): Don't touch ifp->if_flags in usbnet_s...



details:   https://anonhg.NetBSD.org/src/rev/698be8c5923b
branches:  trunk
changeset: 369600:698be8c5923b
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Tue Aug 23 01:08:04 2022 +0000

description:
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:

 sys/dev/usb/usbnet.c |  11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diffs (33 lines):

diff -r 85270a7a3135 -r 698be8c5923b sys/dev/usb/usbnet.c
--- a/sys/dev/usb/usbnet.c      Tue Aug 23 01:05:50 2022 +0000
+++ b/sys/dev/usb/usbnet.c      Tue Aug 23 01:08:04 2022 +0000
@@ -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_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;
        }
 



Home | Main Index | Thread Index | Old Index