Skip to content

Commit 836b132

Browse files
Alexander Antonovrdementi
authored andcommitted
Fix issue when CPUBUSNO_VALID is 0
1 parent b9028f9 commit 836b132

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/utils.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1342,6 +1342,16 @@ bool get_cpu_bus(uint32 msmDomain, uint32 msmBus, uint32 msmDev, uint32 msmFunc,
13421342
return false;
13431343
}
13441344

1345+
if (!cpuBusValid)
1346+
{
1347+
/**
1348+
* Return true because an unexpected device might appear in the OS due to specific configurations.
1349+
* This ensures the function does not fail in such cases and allows further processing.
1350+
*/
1351+
std::cerr << "CPUBUSNO_VALID is 0" << std::endl;
1352+
return true;
1353+
}
1354+
13451355
cpuBusNo.resize(8);
13461356
for (int i = 0; i < 4; ++i) {
13471357
h.read32(SPR_MSM_REG_CPUBUSNO0_OFFSET + i * 4, &cpuBusNo[i]);

0 commit comments

Comments
 (0)