- if (legendEntry) {
-
- PREFL_MEMOP_PANIC(_segmentCount, IOHistogramSegmentConfig);
- tmpConfigData = OSData::withBytes(_histogramSegmentsConfig,
- (unsigned)_segmentCount *
- (unsigned)sizeof(IOHistogramSegmentConfig));
- if (!tmpConfigData) {
- legendEntry->release();
- goto finish;
- }
-
- tmpDict = OSDynamicCast(OSDictionary, legendEntry->getObject(kIOReportLegendInfoKey));
- if (!tmpDict) {
- legendEntry->release();
- goto finish;
- }
-
- tmpDict->setObject(kIOReportLegendConfigKey, tmpConfigData);
+ PREFL_MEMOP_PANIC(_segmentCount, IOHistogramSegmentConfig);
+ tmpConfigData = OSData::withBytes(_histogramSegmentsConfig,
+ (unsigned)_segmentCount *
+ sizeof(IOHistogramSegmentConfig));
+ if (!tmpConfigData) goto finish;
+
+ tmpDict = OSDynamicCast(OSDictionary,
+ legendEntry->getObject(kIOReportLegendInfoKey));
+ if (!tmpDict) goto finish;
+
+ tmpDict->setObject(kIOReportLegendConfigKey, tmpConfigData);
+
+ // success
+ rval = legendEntry;
+
+finish:
+ if (tmpConfigData) tmpConfigData->release();
+ if (!rval && legendEntry) {
+ legendEntry->release();