From daf4c4831f903847b4532c985ace57718b1082d9 Mon Sep 17 00:00:00 2001 From: Zdenek Styblik Date: Tue, 4 Dec 2012 19:33:26 +0000 Subject: [PATCH] ID: 3528310 - 'lib/ipmi_picmg.c' - NULL reference Commit fixes reference to rsp which can be NULL if there is no response from BMC, eg. KCS driver is not loaded. --- ipmitool/lib/ipmi_picmg.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/ipmitool/lib/ipmi_picmg.c b/ipmitool/lib/ipmi_picmg.c index 7182f63..0a229fe 100644 --- a/ipmitool/lib/ipmi_picmg.c +++ b/ipmitool/lib/ipmi_picmg.c @@ -150,9 +150,13 @@ ipmi_picmg_getaddr(struct ipmi_intf * intf, int argc, char ** argv) } rsp = intf->sendrecv(intf, &req); - if (!rsp || rsp->ccode) { - printf("Error getting address information CC: 0x%02x\n", rsp->ccode); - return -1; + if (!rsp) { + lprintf(LOG_ERR, "No valid response received."); + return (-1); + } else if (rsp->ccode) { + lprintf(LOG_ERR, "Error getting address information CC: 0x%02x", + rsp->ccode); + return (-1); } printf("Hardware Address : 0x%02x\n", rsp->data[1]);