[PATCH phosphor-host-ipmid] Returning correct value from handle_ipmid_command in ipmid.C

OpenBMC Patches openbmc-patches at stwcx.xyz
Tue May 24 18:40:41 AEST 2016


From: Nan Li <bjlinan at cn.ibm.com>

Instead of -1, we return 0xFF(Unspecified error) to the bus.

Signed-off-by: Nan Li <bjlinan at cn.ibm.com>
---
 ipmid.C | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/ipmid.C b/ipmid.C
index 728ba0b..9009cd6 100644
--- a/ipmid.C
+++ b/ipmid.C
@@ -267,6 +267,10 @@ static int handle_ipmi_command(sd_bus_message *m, void *user_data, sd_bus_error
     if(r != 0)
     {
         fprintf(stderr,"ERROR:[0x%X] handling NetFn:[0x%X], Cmd:[0x%X]\n",r, netfn, cmd);
+
+        if(r == -1) {
+           response[0] = IPMI_CC_UNSPECIFIED_ERROR;
+        }
     }
 
     fprintf(ipmiio, "IPMI Response:\n");
-- 
2.8.3




More information about the openbmc mailing list