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.
This commit is contained in:
Zdenek Styblik 2012-12-04 19:33:26 +00:00
parent d2d2f4789d
commit daf4c4831f

View File

@ -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]);