3600965 move the initialization past the null intf check

This commit is contained in:
Ales Ledvinka 2013-01-16 12:08:50 +00:00
parent 75d6c72c5d
commit 9a8a8b7dad

View File

@ -144,7 +144,6 @@ ipmi_openipmi_send_cmd(struct ipmi_intf * intf, struct ipmi_rq * req)
}; };
struct ipmi_ipmb_addr ipmb_addr = { struct ipmi_ipmb_addr ipmb_addr = {
addr_type: IPMI_IPMB_ADDR_TYPE, addr_type: IPMI_IPMB_ADDR_TYPE,
channel: intf->target_channel & 0x0f,
}; };
struct ipmi_req _req; struct ipmi_req _req;
static struct ipmi_rs rsp; static struct ipmi_rs rsp;
@ -158,6 +157,8 @@ ipmi_openipmi_send_cmd(struct ipmi_intf * intf, struct ipmi_rq * req)
if (intf == NULL || req == NULL) if (intf == NULL || req == NULL)
return NULL; return NULL;
ipmb_addr.channel = intf->target_channel & 0x0f;
if (intf->opened == 0 && intf->open != NULL) if (intf->opened == 0 && intf->open != NULL)
if (intf->open(intf) < 0) if (intf->open(intf) < 0)
return NULL; return NULL;