Check for division by zero.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35756 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -144,13 +144,16 @@ est_msr_info(uint64 msr, freq_info** _frequencyInfos)
|
|||||||
|
|
||||||
int32 freq = info.cpu_clock_speed / 1000000;
|
int32 freq = info.cpu_clock_speed / 1000000;
|
||||||
uint16 id = msr >> 32;
|
uint16 id = msr >> 32;
|
||||||
int32 bus = freq / (id >> 8);
|
int32 bus = 0;
|
||||||
|
if (id >> 8)
|
||||||
|
freq / (id >> 8);
|
||||||
|
|
||||||
TRACE("est: Guessed bus clock (high) of %d MHz\n", int(bus));
|
TRACE("est: Guessed bus clock (high) of %d MHz\n", int(bus));
|
||||||
if (!bus_speed_ok(bus)) {
|
if (!bus_speed_ok(bus)) {
|
||||||
// We may be running on the low frequency.
|
// We may be running on the low frequency.
|
||||||
id = msr >> 48;
|
id = msr >> 48;
|
||||||
bus = freq / (id >> 8);
|
if (id >> 8)
|
||||||
|
bus = freq / (id >> 8);
|
||||||
TRACE("est: Guessed bus clock (low) of %d MHz\n", int(bus));
|
TRACE("est: Guessed bus clock (low) of %d MHz\n", int(bus));
|
||||||
if (!bus_speed_ok(bus))
|
if (!bus_speed_ok(bus))
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
|
|||||||
Reference in New Issue
Block a user