Crash when ecc count sysfile cannot be read

Replace assert with error handling code.

Change-Id: I6500ae4d38a8caea87828aa7d76373d20c8354c7
Cette révision appartient à :
Bill(Shuzhou) Liu
2023-07-31 08:35:24 -05:00
Parent aeb6c61f54
révision 0522439ac2
+1 -2
Voir le fichier
@@ -682,6 +682,7 @@ rsmi_dev_ecc_count_get(uint32_t dv_ind, rsmi_gpu_block_t block,
DEVICE_MUTEX
ret = GetDevValueVec(type, dv_ind, &val_vec);
if (val_vec.size() != 2 ) ret = RSMI_STATUS_FILE_ERROR;
if (ret == RSMI_STATUS_FILE_ERROR) {
ss << __PRETTY_FUNCTION__ << " | ======= end ======="
@@ -698,8 +699,6 @@ rsmi_dev_ecc_count_get(uint32_t dv_ind, rsmi_gpu_block_t block,
return ret;
}
assert(val_vec.size() == 2);
std::string junk;
std::istringstream fs1(val_vec[0]);