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): Assert core lock is held on usbnet_se...



details:   https://anonhg.NetBSD.org/src/rev/3a5987bb06ec
branches:  trunk
changeset: 369500:3a5987bb06ec
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Sat Aug 20 14:07:53 2022 +0000

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

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

diffs (26 lines):

diff -r 8d2ed65ebe0f -r 3a5987bb06ec sys/dev/usb/usbnet.c
--- a/sys/dev/usb/usbnet.c      Sat Aug 20 14:06:20 2022 +0000
+++ b/sys/dev/usb/usbnet.c      Sat Aug 20 14:07:53 2022 +0000
@@ -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 @@
 void
 usbnet_set_link(struct usbnet *un, bool link)
 {
+       usbnet_isowned_core(un);
        un->un_pri->unp_link = link;
 }
 



Home | Main Index | Thread Index | Old Index