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
This commit is contained in:
parent
bdbf5e4196
commit
60a84f4c27
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue