host-bmc: Migrate to pldm_entity_association_pdr_add_from_node_check()
pldm_entity_association_pdr_add_from_node() is deprecated in libpldm as
it relied on assert() to communicate failures from the implementation.
pldm_entity_association_pdr_add_from_node_check() instead returns a
value indicating success or failure.
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: If5ef1f372f0e835e8d97affcaab7a9abc2625d97
diff --git a/host-bmc/host_pdr_handler.cpp b/host-bmc/host_pdr_handler.cpp
index 886ca58..1913f0b 100644
--- a/host-bmc/host_pdr_handler.cpp
+++ b/host-bmc/host_pdr_handler.cpp
@@ -253,8 +253,14 @@
}
else
{
- pldm_entity_association_pdr_add_from_node(
+ int rc = pldm_entity_association_pdr_add_from_node_check(
node, repo, &entities, numEntities, true, TERMINUS_HANDLE);
+ if (rc)
+ {
+ error(
+ "Failed to add entity association PDR from node: {LIBPLDM_ERROR}",
+ "LIBPLDM_ERROR", rc);
+ }
}
}
free(entities);