summaryrefslogtreecommitdiff
path: root/redfish-core/lib/sensors.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'redfish-core/lib/sensors.hpp')
-rw-r--r--redfish-core/lib/sensors.hpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/redfish-core/lib/sensors.hpp b/redfish-core/lib/sensors.hpp
index 3cd437982d..627ba7e50e 100644
--- a/redfish-core/lib/sensors.hpp
+++ b/redfish-core/lib/sensors.hpp
@@ -531,11 +531,10 @@ void getChassis(const std::shared_ptr<bmcweb::AsyncResp>& asyncResp,
return;
}
const std::string* chassisPath = nullptr;
- std::string chassisName;
for (const std::string& chassis : chassisPaths)
{
sdbusplus::message::object_path path(chassis);
- chassisName = path.filename();
+ std::string chassisName = path.filename();
if (chassisName.empty())
{
BMCWEB_LOG_ERROR << "Failed to find '/' in " << chassis;