diff --git a/projects/amdsmi/rocm_smi/src/rocm_smi_utils.cc b/projects/amdsmi/rocm_smi/src/rocm_smi_utils.cc index 93ff80be74..e372209ef1 100755 --- a/projects/amdsmi/rocm_smi/src/rocm_smi_utils.cc +++ b/projects/amdsmi/rocm_smi/src/rocm_smi_utils.cc @@ -120,6 +120,9 @@ int WriteSysfsStr(std::string path, std::string val) { fs << val; fs.close(); + if (!fs) { + return ENOENT; // Map to NOT_SUPPORT if errors + } return ret; }