From 09e0288ab0dc1c75c702c5d6194e9e80521b4fbd Mon Sep 17 00:00:00 2001 From: Alastair Poole Date: Tue, 10 Nov 2020 02:06:34 +0000 Subject: [PATCH] cpu: small fix to logic. --- src/bin/system/machine/cpu.bogox | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/bin/system/machine/cpu.bogox b/src/bin/system/machine/cpu.bogox index b57719b..f0b395d 100644 --- a/src/bin/system/machine/cpu.bogox +++ b/src/bin/system/machine/cpu.bogox @@ -492,7 +492,8 @@ system_cpu_frequency_min_max_get(int *min, int *max) free(s); *min = freq_min; *max = freq_max; - return 0; + if (freq_min < freq_max) + return 0; } } @@ -503,8 +504,11 @@ system_cpu_frequency_min_max_get(int *min, int *max) while (t) { int freq = atoi(t); - if (freq > freq_max) freq_max = freq; - if (freq < freq_min) freq_min = freq; + if (freq != 0) + { + if (freq > freq_max) freq_max = freq; + if (freq < freq_min) freq_min = freq; + } t = strtok(NULL, " "); }