From 9a8a8b7dad71dfcac9af87a89eedcf4498aa0cbe Mon Sep 17 00:00:00 2001 From: Ales Ledvinka Date: Wed, 16 Jan 2013 12:08:50 +0000 Subject: [PATCH] 3600965 move the initialization past the null intf check --- ipmitool/src/plugins/open/open.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ipmitool/src/plugins/open/open.c b/ipmitool/src/plugins/open/open.c index 6accb9e..ba4d25b 100644 --- a/ipmitool/src/plugins/open/open.c +++ b/ipmitool/src/plugins/open/open.c @@ -144,7 +144,6 @@ ipmi_openipmi_send_cmd(struct ipmi_intf * intf, struct ipmi_rq * req) }; struct ipmi_ipmb_addr ipmb_addr = { addr_type: IPMI_IPMB_ADDR_TYPE, - channel: intf->target_channel & 0x0f, }; struct ipmi_req _req; 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) return NULL; + ipmb_addr.channel = intf->target_channel & 0x0f; + if (intf->opened == 0 && intf->open != NULL) if (intf->open(intf) < 0) return NULL;