diff options
author | njl <njl@FreeBSD.org> | 2007-08-19 20:34:13 +0000 |
---|---|---|
committer | njl <njl@FreeBSD.org> | 2007-08-19 20:34:13 +0000 |
commit | 7d2f2820572ca43c54851bca79c520f6fe6de70f (patch) | |
tree | 650306e8a7e0039cf34073eaa5e73efc4bdaa476 /sys/kern/kern_cpu.c | |
parent | b151d17a1b0aaf0d64709c302aee875044239826 (diff) | |
download | FreeBSD-src-7d2f2820572ca43c54851bca79c520f6fe6de70f.zip FreeBSD-src-7d2f2820572ca43c54851bca79c520f6fe6de70f.tar.gz |
Use a different loop variable for the inner loop. This previous reuse could
have caused a hang, but we got lucky with the available multi-CPU states
on actual hardware.
Submitted by: Bjorn Koenig <bkoenig / alpha-tierchen.de>
Approved by: re
MFC after: 3 days
Diffstat (limited to 'sys/kern/kern_cpu.c')
-rw-r--r-- | sys/kern/kern_cpu.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sys/kern/kern_cpu.c b/sys/kern/kern_cpu.c index 6a72b9c..1b631b9 100644 --- a/sys/kern/kern_cpu.c +++ b/sys/kern/kern_cpu.c @@ -396,7 +396,7 @@ cf_get_method(device_t dev, struct cf_level *level) struct cf_setting *curr_set, set; struct pcpu *pc; device_t *devs; - int count, error, i, numdevs; + int count, error, i, n, numdevs; uint64_t rate; sc = device_get_softc(dev); @@ -443,10 +443,10 @@ cf_get_method(device_t dev, struct cf_level *level) * The estimation code below catches this case though. */ CF_MTX_LOCK(&sc->lock); - for (i = 0; i < numdevs && curr_set->freq == CPUFREQ_VAL_UNKNOWN; i++) { - if (!device_is_attached(devs[i])) + for (n = 0; n < numdevs && curr_set->freq == CPUFREQ_VAL_UNKNOWN; n++) { + if (!device_is_attached(devs[n])) continue; - error = CPUFREQ_DRV_GET(devs[i], &set); + error = CPUFREQ_DRV_GET(devs[n], &set); if (error) continue; for (i = 0; i < count; i++) { |