]> git.saurik.com Git - apple/xnu.git/blobdiff - iokit/Kernel/IOStateReporter.cpp
xnu-4570.51.1.tar.gz
[apple/xnu.git] / iokit / Kernel / IOStateReporter.cpp
index 0eaeb6f1dfe4719e056fc35a098e13c151058b8a..e1214dc550367e8aaca5ef2a6b46fead763f3381 100644 (file)
@@ -40,7 +40,7 @@ IOStateReporter*
 IOStateReporter::with(IOService *reportingService,
                       IOReportCategories categories,
                       int nstates,
-                      IOReportUnits unit/* = kIOReportUnitHWTicks*/)
+                      IOReportUnit unit/* = kIOReportUnitHWTicks*/)
 {
     IOStateReporter *reporter, *rval = NULL;
     
@@ -58,7 +58,7 @@ IOStateReporter::with(IOService *reportingService,
     
 finish:
     if (!rval) {
-        if (reporter)       delete reporter;
+        OSSafeReleaseNULL(reporter);
     }
     
     return rval;
@@ -68,7 +68,7 @@ bool
 IOStateReporter::initWith(IOService *reportingService,
                           IOReportCategories categories,
                           int16_t nstates,
-                          IOReportUnits unit)
+                          IOReportUnit unit)
 {
     bool success = false;
     
@@ -778,6 +778,7 @@ IOStateReporter::_getStateValue(uint64_t channel_id,
                             break;
                         case kLastTransitionTime:
                             result = values->last_intransition;
+                            break;
                         default:
                             break;
                     }