summaryrefslogtreecommitdiffstats
path: root/tdecore/tdehardwaredevices.cpp
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-09-26 17:52:04 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-09-26 17:52:04 -0500
commit5828c385270e844f5c8feb0d960198b9da60f403 (patch)
treebb823dba5e252f048ab5d717d884c7457af70949 /tdecore/tdehardwaredevices.cpp
parent5242023c3f52caf7a2e2c19de3ab7768b71d12a5 (diff)
downloadtdelibs-5828c385270e844f5c8feb0d960198b9da60f403.tar.gz
tdelibs-5828c385270e844f5c8feb0d960198b9da60f403.zip
Fix TDEHW crash when cpufreq not available
Diffstat (limited to 'tdecore/tdehardwaredevices.cpp')
-rw-r--r--tdecore/tdehardwaredevices.cpp34
1 files changed, 18 insertions, 16 deletions
diff --git a/tdecore/tdehardwaredevices.cpp b/tdecore/tdehardwaredevices.cpp
index 7e8b462eb..972871919 100644
--- a/tdecore/tdehardwaredevices.cpp
+++ b/tdecore/tdehardwaredevices.cpp
@@ -2133,22 +2133,24 @@ void TDEHardwareDevices::processModifiedCPUs() {
}
// Update CPU information structure
- if (cdevice->governor() != scalinggovernor) modified = true;
- cdevice->internalSetGovernor(scalinggovernor);
- if (cdevice->scalingDriver() != scalingdriver) modified = true;
- cdevice->internalSetScalingDriver(scalingdriver);
- if (cdevice->minFrequency() != minfrequency) modified = true;
- cdevice->internalSetMinFrequency(minfrequency);
- if (cdevice->maxFrequency() != maxfrequency) modified = true;
- cdevice->internalSetMaxFrequency(maxfrequency);
- if (cdevice->transitionLatency() != trlatency) modified = true;
- cdevice->internalSetTransitionLatency(trlatency);
- if (cdevice->dependentProcessors().join(" ") != affectedcpulist.join(" ")) modified = true;
- cdevice->internalSetDependentProcessors(affectedcpulist);
- if (cdevice->availableFrequencies().join(" ") != frequencylist.join(" ")) modified = true;
- cdevice->internalSetAvailableFrequencies(frequencylist);
- if (cdevice->availableGovernors().join(" ") != governorlist.join(" ")) modified = true;
- cdevice->internalSetAvailableGovernors(governorlist);
+ if (cdevice) {
+ if (cdevice->governor() != scalinggovernor) modified = true;
+ cdevice->internalSetGovernor(scalinggovernor);
+ if (cdevice->scalingDriver() != scalingdriver) modified = true;
+ cdevice->internalSetScalingDriver(scalingdriver);
+ if (cdevice->minFrequency() != minfrequency) modified = true;
+ cdevice->internalSetMinFrequency(minfrequency);
+ if (cdevice->maxFrequency() != maxfrequency) modified = true;
+ cdevice->internalSetMaxFrequency(maxfrequency);
+ if (cdevice->transitionLatency() != trlatency) modified = true;
+ cdevice->internalSetTransitionLatency(trlatency);
+ if (cdevice->dependentProcessors().join(" ") != affectedcpulist.join(" ")) modified = true;
+ cdevice->internalSetDependentProcessors(affectedcpulist);
+ if (cdevice->availableFrequencies().join(" ") != frequencylist.join(" ")) modified = true;
+ cdevice->internalSetAvailableFrequencies(frequencylist);
+ if (cdevice->availableGovernors().join(" ") != governorlist.join(" ")) modified = true;
+ cdevice->internalSetAvailableGovernors(governorlist);
+ }
}
if (modified) {