Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci Fix race when freeing sensors.



details:   https://anonhg.NetBSD.org/src/rev/ea81f2444067
branches:  trunk
changeset: 379656:ea81f2444067
user:      mlelstv <mlelstv%NetBSD.org@localhost>
date:      Sun Jun 13 10:04:10 2021 +0000

description:
Fix race when freeing sensors.

diffstat:

 sys/dev/pci/arcmsr.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (30 lines):

diff -r edc062d0c596 -r ea81f2444067 sys/dev/pci/arcmsr.c
--- a/sys/dev/pci/arcmsr.c      Sun Jun 13 10:01:43 2021 +0000
+++ b/sys/dev/pci/arcmsr.c      Sun Jun 13 10:04:10 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: arcmsr.c,v 1.41 2021/04/24 23:36:57 thorpej Exp $ */
+/*     $NetBSD: arcmsr.c,v 1.42 2021/06/13 10:04:10 mlelstv Exp $ */
 /*     $OpenBSD: arc.c,v 1.68 2007/10/27 03:28:27 dlg Exp $ */
 
 /*
@@ -21,7 +21,7 @@
 #include "bio.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: arcmsr.c,v 1.41 2021/04/24 23:36:57 thorpej Exp $");
+__KERNEL_RCSID(0, "$NetBSD: arcmsr.c,v 1.42 2021/06/13 10:04:10 mlelstv Exp $");
 
 #include <sys/param.h>
 #include <sys/buf.h>
@@ -1884,9 +1884,9 @@ arc_create_sensors(void *arg)
 
 bad:
        sysmon_envsys_destroy(sc->sc_sme);
-       kmem_free(sc->sc_arc_sensors, slen);
+       sc->sc_sme = NULL;
 
-       sc->sc_sme = NULL;
+       kmem_free(sc->sc_arc_sensors, slen);
        sc->sc_arc_sensors = NULL;
 
        kthread_exit(0);



Home | Main Index | Thread Index | Old Index