diff --git a/src/tests/ras/utils/dimm/dimm.cc b/src/tests/ras/utils/dimm/dimm.cc index 0972267..8d964c0 100644 --- a/src/tests/ras/utils/dimm/dimm.cc +++ b/src/tests/ras/utils/dimm/dimm.cc @@ -43,7 +43,9 @@ const int USC_VALID_FLAG = 1 << 5; int Dimm::GetShutdownCount() const { struct ndctl_cmd *cmd = ndctl_dimm_cmd_new_smart(dimm_); - if (ndctl_cmd_submit(cmd)) { + int ret = 0; + ret = ndctl_cmd_submit(cmd); + if (ret) { return -1; } @@ -57,7 +59,9 @@ int Dimm::GetShutdownCount() const { int Dimm::InjectUnsafeShutdown() const { struct ndctl_cmd *cmd = ndctl_dimm_cmd_new_ack_shutdown_count(dimm_); - if (ndctl_cmd_submit(cmd)) { + int ret = 0; + ret = ndctl_cmd_submit(cmd); + if (ret) { return -1; } @@ -73,7 +77,8 @@ int Dimm::InjectUnsafeShutdown() const { return -1; } - if (ndctl_cmd_submit(cmd)) { + ret = ndctl_cmd_submit(cmd); + if (ret) { return -1; }