Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/x86/pci sc->sc_sensor cannot be NULL since it was j...



details:   https://anonhg.NetBSD.org/src/rev/714cc9dfb702
branches:  trunk
changeset: 829350:714cc9dfb702
user:      pgoyette <pgoyette%NetBSD.org@localhost>
date:      Fri Jan 26 23:01:44 2018 +0000

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

diffstat:

 sys/arch/x86/pci/amdzentemp.c |  10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diffs (31 lines):

diff -r 1b536e16b3af -r 714cc9dfb702 sys/arch/x86/pci/amdzentemp.c
--- a/sys/arch/x86/pci/amdzentemp.c     Fri Jan 26 22:58:09 2018 +0000
+++ b/sys/arch/x86/pci/amdzentemp.c     Fri Jan 26 23:01:44 2018 +0000
@@ -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 @@
                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



Home | Main Index | Thread Index | Old Index