Fix a crash when running amd-smi version --cpu
When running on a system that doesn't support HSMP (such as an APU) then the following is observed: ``` /usr/include/c++/15.1.1/bits/stl_vector.h:1263: std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](size_type) [with _Tp = void*; _Alloc = std::allocator<void*>; reference = void*&; size_type = long unsigned int]: Assertion '__n < this->size()' failed. ``` This is because no "CPU" are detected on the SOC, which really means no CPUs that support HSMP. Catch this case so that a clean return can be passed up. Signed-off-by: Mario Limonciello (AMD) <superm1@kernel.org>
Цей коміт міститься в:
зафіксовано
Arif, Maisam
джерело
c876180875
коміт
e5d9e1361e
@@ -6309,6 +6309,8 @@ amdsmi_status_t amdsmi_get_cpu_handles(uint32_t *cpu_count,
|
||||
nullptr, &cpu_per_soc);
|
||||
if (status != AMDSMI_STATUS_SUCCESS)
|
||||
return status;
|
||||
if (cpu_per_soc == 0)
|
||||
continue;
|
||||
|
||||
// Allocate the memory for the cpus
|
||||
std::vector<amdsmi_processor_handle> plist(cpu_per_soc);
|
||||
|
||||
Посилання в новій задачі
Заблокувати користувача