Attn: Code cleanup based on local CI build output
Modified code based on recommendations from local CI build. Cleaned up
some potential null pointer dereferencing code.
Signed-off-by: Ben Tyner <ben.tyner@ibm.com>
Change-Id: I17fb40b25ce37627627c5112a6be786e2bac7c1f
diff --git a/attn/ti_handler.cpp b/attn/ti_handler.cpp
index eee3553..6c3f26c 100644
--- a/attn/ti_handler.cpp
+++ b/attn/ti_handler.cpp
@@ -243,6 +243,10 @@
void parseRawTiInfo(std::map<std::string, std::string>& i_map,
TiDataArea* i_buffer)
{
+ if (nullptr == i_buffer)
+ {
+ return;
+ }
uint32_t* tiDataArea = (uint32_t*)i_buffer;
std::stringstream ss;
@@ -269,6 +273,11 @@
void parsePhypOpalTiInfo(std::map<std::string, std::string>& i_map,
TiDataArea* i_tiDataArea)
{
+ if (nullptr == i_tiDataArea)
+ {
+ return;
+ }
+
std::stringstream ss;
ss << std::hex << std::showbase;
@@ -317,6 +326,11 @@
void parseHbTiInfo(std::map<std::string, std::string>& i_map,
TiDataArea* i_tiDataArea)
{
+ if (nullptr == i_tiDataArea)
+ {
+ return;
+ }
+
std::stringstream ss;
ss << std::hex << std::showbase;