Module Name:    src
Committed By:   mlelstv
Date:           Sun Jun 13 09:47:36 UTC 2021

Modified Files:
        src/sys/dev/i2c: sdtemp.c

Log Message:
Clear sc_sme pointer to avoid double free.


To generate a diff of this commit:
cvs rdiff -u -r1.39 -r1.40 src/sys/dev/i2c/sdtemp.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/i2c/sdtemp.c
diff -u src/sys/dev/i2c/sdtemp.c:1.39 src/sys/dev/i2c/sdtemp.c:1.40
--- src/sys/dev/i2c/sdtemp.c:1.39	Tue Jun 30 19:02:42 2020
+++ src/sys/dev/i2c/sdtemp.c	Sun Jun 13 09:47:36 2021
@@ -1,4 +1,4 @@
-/*      $NetBSD: sdtemp.c,v 1.39 2020/06/30 19:02:42 msaitoh Exp $        */
+/*      $NetBSD: sdtemp.c,v 1.40 2021/06/13 09:47:36 mlelstv Exp $        */
 
 /*
  * Copyright (c) 2009 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sdtemp.c,v 1.39 2020/06/30 19:02:42 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sdtemp.c,v 1.40 2021/06/13 09:47:36 mlelstv Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -405,6 +405,7 @@ sdtemp_attach(device_t parent, device_t 
 bad:
 	kmem_free(sc->sc_sensor, sizeof(envsys_data_t));
 	sysmon_envsys_destroy(sc->sc_sme);
+	sc->sc_sme = NULL;
 }
 
 static int

Reply via email to