Module Name:    src
Committed By:   riastradh
Date:           Sat Aug 20 12:28:25 UTC 2022

Modified Files:
        src/sys/dev/usb: usbnet.c

Log Message:
usbnet(9): Avoid ether_mediachange if stopped.

We are called without IFNET_LOCK held here, so touching ifp->if_flags
is forbidden, but that's the first thing ether_mediachange does.

XXX not right either, need to eliminate the check from
ether_mediachange


To generate a diff of this commit:
cvs rdiff -u -r1.97 -r1.98 src/sys/dev/usb/usbnet.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/usbnet.c
diff -u src/sys/dev/usb/usbnet.c:1.97 src/sys/dev/usb/usbnet.c:1.98
--- src/sys/dev/usb/usbnet.c:1.97	Tue Aug 16 00:44:20 2022
+++ src/sys/dev/usb/usbnet.c	Sat Aug 20 12:28:25 2022
@@ -1,4 +1,4 @@
-/*	$NetBSD: usbnet.c,v 1.97 2022/08/16 00:44:20 riastradh Exp $	*/
+/*	$NetBSD: usbnet.c,v 1.98 2022/08/20 12:28:25 riastradh Exp $	*/
 
 /*
  * Copyright (c) 2019 Matthew R. Green
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: usbnet.c,v 1.97 2022/08/16 00:44:20 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usbnet.c,v 1.98 2022/08/20 12:28:25 riastradh Exp $");
 
 #include <sys/param.h>
 #include <sys/kernel.h>
@@ -986,6 +986,8 @@ usbnet_media_upd(struct ifnet *ifp)
 			mii_phy_reset(miisc);
 	}
 
+	if (unp->unp_stopping)
+		return 0;
 	return ether_mediachange(ifp);
 }
 

Reply via email to