Module Name:    src
Committed By:   pgoyette
Date:           Fri Jan 26 23:01:44 UTC 2018

Modified Files:
        src/sys/arch/x86/pci: amdzentemp.c

Log Message:
sc->sc_sensor cannot be NULL since it was just allocated with KM_SLEEP
(which cannot fail).  So remove the NULL-check.  CID/1428644


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/x86/pci/amdzentemp.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/arch/x86/pci/amdzentemp.c
diff -u src/sys/arch/x86/pci/amdzentemp.c:1.6 src/sys/arch/x86/pci/amdzentemp.c:1.7
--- src/sys/arch/x86/pci/amdzentemp.c:1.6	Thu Jan 25 23:37:33 2018
+++ src/sys/arch/x86/pci/amdzentemp.c	Fri Jan 26 23:01:44 2018
@@ -1,4 +1,4 @@
-/*      $NetBSD: amdzentemp.c,v 1.6 2018/01/25 23:37:33 pgoyette Exp $ */
+/*      $NetBSD: amdzentemp.c,v 1.7 2018/01/26 23:01:44 pgoyette Exp $ */
 /*      $OpenBSD: kate.c,v 1.2 2008/03/27 04:52:03 cnst Exp $   */
 
 /*
@@ -50,7 +50,7 @@
 
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: amdzentemp.c,v 1.6 2018/01/25 23:37:33 pgoyette Exp $ ");
+__KERNEL_RCSID(0, "$NetBSD: amdzentemp.c,v 1.7 2018/01/26 23:01:44 pgoyette Exp $ ");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -167,10 +167,8 @@ bad:
 		sc->sc_sme = NULL;
 	}
 
-	if (sc->sc_sensor != NULL) {
-		kmem_free(sc->sc_sensor, sc->sc_sensor_len);
-		sc->sc_sensor = NULL;
-	}
+	kmem_free(sc->sc_sensor, sc->sc_sensor_len);
+	sc->sc_sensor = NULL;
 }
 
 static int

Reply via email to