Loading...
iokit/Kernel/IOStateReporter.cpp xnu-2782.40.9 xnu-4570.71.2
--- xnu/xnu-2782.40.9/iokit/Kernel/IOStateReporter.cpp
+++ xnu/xnu-4570.71.2/iokit/Kernel/IOStateReporter.cpp
@@ -40,7 +40,7 @@
 IOStateReporter::with(IOService *reportingService,
                       IOReportCategories categories,
                       int nstates,
-                      IOReportUnits unit/* = kIOReportUnitHWTicks*/)
+                      IOReportUnit unit/* = kIOReportUnitHWTicks*/)
 {
     IOStateReporter *reporter, *rval = NULL;
     
@@ -58,7 +58,7 @@
     
 finish:
     if (!rval) {
-        if (reporter)       delete reporter;
+        OSSafeReleaseNULL(reporter);
     }
     
     return rval;
@@ -68,7 +68,7 @@
 IOStateReporter::initWith(IOService *reportingService,
                           IOReportCategories categories,
                           int16_t nstates,
-                          IOReportUnits unit)
+                          IOReportUnit unit)
 {
     bool success = false;
     
@@ -778,6 +778,7 @@
                             break;
                         case kLastTransitionTime:
                             result = values->last_intransition;
+                            break;
                         default:
                             break;
                     }