Module Name: src
Committed By: riastradh
Date: Sat Aug 20 14:07:53 UTC 2022
Modified Files:
src/sys/dev/usb: usbnet.c
Log Message:
usbnet(9): Assert core lock is held on usbnet_set_link.
This is only allowed to be called via the uno_statchg callback, which
in turn is called only with the core lock held. (usbnet_set_link is
also called internally in usbnet(9) with the core lock held.)
To generate a diff of this commit:
cvs rdiff -u -r1.102 -r1.103 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.102 src/sys/dev/usb/usbnet.c:1.103
--- src/sys/dev/usb/usbnet.c:1.102 Sat Aug 20 14:06:20 2022
+++ src/sys/dev/usb/usbnet.c Sat Aug 20 14:07:53 2022
@@ -1,4 +1,4 @@
-/* $NetBSD: usbnet.c,v 1.102 2022/08/20 14:06:20 riastradh Exp $ */
+/* $NetBSD: usbnet.c,v 1.103 2022/08/20 14:07:53 riastradh Exp $ */
/*
* Copyright (c) 2019 Matthew R. Green
@@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: usbnet.c,v 1.102 2022/08/20 14:06:20 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usbnet.c,v 1.103 2022/08/20 14:07:53 riastradh Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@@ -1296,6 +1296,7 @@ out: mutex_exit(&un->un_pri->unp_core_lo
void
usbnet_set_link(struct usbnet *un, bool link)
{
+ usbnet_isowned_core(un);
un->un_pri->unp_link = link;
}