Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/xen/xenbus Grab KERNEL_LOCK before calling config_f...



details:   https://anonhg.NetBSD.org/src/rev/0230edd418a3
branches:  trunk
changeset: 1021765:0230edd418a3
user:      bouyer <bouyer%NetBSD.org@localhost>
date:      Wed Jun 16 10:49:50 2021 +0000

description:
Grab KERNEL_LOCK before calling config_found()

diffstat:

 sys/arch/xen/xenbus/xenbus_probe.c |  9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diffs (41 lines):

diff -r a4cd08117384 -r 0230edd418a3 sys/arch/xen/xenbus/xenbus_probe.c
--- a/sys/arch/xen/xenbus/xenbus_probe.c        Wed Jun 16 10:21:51 2021 +0000
+++ b/sys/arch/xen/xenbus/xenbus_probe.c        Wed Jun 16 10:49:50 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: xenbus_probe.c,v 1.56 2021/04/24 23:36:52 thorpej Exp $ */
+/* $NetBSD: xenbus_probe.c,v 1.57 2021/06/16 10:49:50 bouyer Exp $ */
 /******************************************************************************
  * Talks to Xen Store to figure out what devices we have.
  *
@@ -29,7 +29,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: xenbus_probe.c,v 1.56 2021/04/24 23:36:52 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: xenbus_probe.c,v 1.57 2021/06/16 10:49:50 bouyer Exp $");
 
 #if 0
 #define DPRINTK(fmt, args...) \
@@ -469,8 +469,11 @@
                                kmem_free(xbusd, xbusd->xbusd_sz);
                                break;
                        }
+
+                       KERNEL_LOCK(1, curlwp);
                        xbusd->xbusd_u.f.f_dev = config_found(xenbus_dev,
                            &xa, xenbus_print, CFARG_EOL);
+                       KERNEL_UNLOCK_ONE(curlwp);
                        if (xbusd->xbusd_u.f.f_dev == NULL) {
                                kmem_free(xbusd, xbusd->xbusd_sz);
                                continue;
@@ -652,8 +655,10 @@
        register_xenbus_watch(&be_watch);
 
        /* attach balloon. */
+       KERNEL_LOCK(1, curlwp);
        config_found(xenbus_dev, &balloon_xa, xenbus_print,
            CFARG_EOL);
+       KERNEL_UNLOCK_ONE(curlwp);
 
        shutdown_xenbus_setup();
 



Home | Main Index | Thread Index | Old Index