Attn: Fix attn handler crash when cfam read fails
When attention handler encounters an error while handling attentions it
will generate a PEL to track these errors. There was a bug in the code
causing attention handler to think it was handling a TI and try to
determine the subsystem (hostboot or phyp) which is only valid in a real
TI PEL case. The result was a stoi() on an invalid subsystem id.
Signed-off-by: Ben Tyner <ben.tyner@ibm.com>
Change-Id: Icc1cc4762a38854f14f3fe992fa645ccfed4c8f1
diff --git a/attn/attn_logging.cpp b/attn/attn_logging.cpp
index 73eebdf..d930f5d 100644
--- a/attn/attn_logging.cpp
+++ b/attn/attn_logging.cpp
@@ -405,17 +405,18 @@
close(pelFd);
}
- }
- uint8_t subsystem = std::stoi(i_additional["Subsystem"]);
+ uint8_t subsystem = std::stoi(i_additional["Subsystem"]);
- // If not hypervisor TI
- if (static_cast<uint8_t>(pel::SubsystemID::hypervisor) != subsystem)
- {
- // Request a dump and transition the host
- if ("true" == i_additional["Dump"])
+ // If not hypervisor TI
+ if (static_cast<uint8_t>(pel::SubsystemID::hypervisor) != subsystem)
{
- requestDump(pelId); // will not return until dump is complete
+ // Request a dump and transition the host
+ if ("true" == i_additional["Dump"])
+ {
+ // will not return until dump is complete
+ requestDump(pelId);
+ }
}
}
}