Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/usb autoconf(9) requires the kernel_lock so take it ...



details:   https://anonhg.NetBSD.org/src/rev/ef1bee9eb7f2
branches:  trunk
changeset: 814942:ef1bee9eb7f2
user:      skrll <skrll%NetBSD.org@localhost>
date:      Thu Apr 21 15:42:56 2016 +0000

description:
autoconf(9) requires the kernel_lock so take it while discovering new
devices.

PR/51081: calling ioctl while attaching wifi device causes a jump to NULL

diffstat:

 sys/dev/usb/usb_subr.c |  8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diffs (40 lines):

diff -r db3e2ff1400a -r ef1bee9eb7f2 sys/dev/usb/usb_subr.c
--- a/sys/dev/usb/usb_subr.c    Thu Apr 21 09:46:49 2016 +0000
+++ b/sys/dev/usb/usb_subr.c    Thu Apr 21 15:42:56 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: usb_subr.c,v 1.208 2016/01/07 07:59:08 skrll Exp $     */
+/*     $NetBSD: usb_subr.c,v 1.209 2016/04/21 15:42:56 skrll Exp $     */
 /*     $FreeBSD: src/sys/dev/usb/usb_subr.c,v 1.18 1999/11/17 22:33:47 n_hibma Exp $   */
 
 /*
@@ -32,7 +32,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: usb_subr.c,v 1.208 2016/01/07 07:59:08 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: usb_subr.c,v 1.209 2016/04/21 15:42:56 skrll Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -861,8 +861,10 @@
        dlocs[USBDEVIFCF_CONFIGURATION] = -1;
        dlocs[USBDEVIFCF_INTERFACE] = -1;
 
+       KERNEL_LOCK(1, NULL);
        dv = config_found_sm_loc(parent, "usbdevif", dlocs, &uaa, usbd_print,
                                 config_stdsubmatch);
+       KERNEL_UNLOCK_ONE(NULL);
        if (dv) {
                dev->subdevs = malloc(sizeof dv, M_USB, M_NOWAIT);
                if (dev->subdevs == NULL)
@@ -939,8 +941,10 @@
                            loc != uiaa.ifaceno)
                                continue;
                }
+               KERNEL_LOCK(1, NULL);
                dv = config_found_sm_loc(parent, "usbifif", ilocs, &uiaa,
                                         usbd_ifprint, config_stdsubmatch);
+               KERNEL_UNLOCK_ONE(NULL);
                if (!dv)
                        continue;
 



Home | Main Index | Thread Index | Old Index