diff --git a/src/rocm_smi_device.cc b/src/rocm_smi_device.cc index 735fece6ed..23675a9e6a 100755 --- a/src/rocm_smi_device.cc +++ b/src/rocm_smi_device.cc @@ -129,9 +129,10 @@ int Device::openSysfsFileStream(DevInfoTypes type, T *fs, bool write) { if (env_->path_DRM_root_override && type == env_->enum_override) { sysfs_path = env_->path_DRM_root_override; - } - if (write) { - sysfs_path += ".write"; + + if (write) { + sysfs_path += ".write"; + } } sysfs_path += "/device/";