summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Venture <venture@google.com>2018-09-10 09:24:12 -0700
committerPatrick Venture <venture@google.com>2018-09-10 22:34:16 +0000
commit8f1791448e2da0eda0dae5785becf977309106d5 (patch)
tree2349111658c6f1035f11f95062aed91e3bd2839e
parent54c2e5e2dfdcd069c3688ad5d67ee016cddf4183 (diff)
downloadphosphor-pid-control-8f1791448e2da0eda0dae5785becf977309106d5.tar.gz
phosphor-pid-control-8f1791448e2da0eda0dae5785becf977309106d5.zip
ipmi: add back call to is_method_error
Before reading the message, check if there's an error. The bus call will fail dramatically but differently than the message. Change-Id: I3ab54cc4a4590e0cf5f3eb15dcbf045a7b8bd075 Signed-off-by: Patrick Venture <venture@google.com>
-rw-r--r--ipmi/manualcmds.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/ipmi/manualcmds.cpp b/ipmi/manualcmds.cpp
index 798deab..a82dfa6 100644
--- a/ipmi/manualcmds.cpp
+++ b/ipmi/manualcmds.cpp
@@ -86,9 +86,15 @@ static ipmi_ret_t GetFanCtrlProperty(uint8_t zoneId, bool* value,
try
{
+ PropertyMap propMap;
+
+ /* a method could error but the call not error. */
auto valueResponseMsg = propertyReadBus.call(pimMsg);
+ if (valueResponseMsg.is_method_error())
+ {
+ return IPMI_CC_INVALID;
+ }
- PropertyMap propMap;
valueResponseMsg.read(propMap);
*value = sdbusplus::message::variant_ns::get<bool>(propMap[property]);
OpenPOWER on IntegriCloud