summaryrefslogtreecommitdiff
path: root/sys/dev/usb
diff options
context:
space:
mode:
authorriastradh <riastradh@NetBSD.org>2022-08-20 14:07:53 +0000
committerriastradh <riastradh@NetBSD.org>2022-08-20 14:07:53 +0000
commita6abcadb5386d45fa03d0cbb8840c2d7103eec66 (patch)
tree71516731b0f03c0fe085cfb5bd2296e3b8503a8d /sys/dev/usb
parentbf7dddfcc3c811386f6868d5b9433fe321c206b9 (diff)
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.)
Diffstat (limited to 'sys/dev/usb')
-rw-r--r--sys/dev/usb/usbnet.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/dev/usb/usbnet.c b/sys/dev/usb/usbnet.c
index be012e1436a..1259fdb10a5 100644
--- a/sys/dev/usb/usbnet.c
+++ b/sys/dev/usb/usbnet.c
@@ -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_lock);
void
usbnet_set_link(struct usbnet *un, bool link)
{
+ usbnet_isowned_core(un);
un->un_pri->unp_link = link;
}