Reset ChannelInfo before calling getChannelInfo()
chInfo is initialized with '0' in statement 'ChannelInfo chInfo{};'
This is to make sure even if getChannelInfo function fails to update
chInfo,un-initialized/previous chInfo data will not be used for
further execution in function ipmiOEMSetUser2Activation.
Tested:
By printing structure chInfo for each IPMI channel
before calling getChannelInfo function, we observed that
'chInfo' structure intialized with zeroes for each IPMI channel.
Signed-off-by: Manish Baing <manish.baing@intel.com>
Change-Id: I0fcfabd30d05f4d360758cff31bb98fff01c5f7e
diff --git a/src/oemcommands.cpp b/src/oemcommands.cpp
index 492d2b9..0f6fce9 100644
--- a/src/oemcommands.cpp
+++ b/src/oemcommands.cpp
@@ -1057,7 +1057,7 @@
// Check for System Interface not exist and LAN should be static
for (uint8_t channel = 0; channel < maxIpmiChannels; channel++)
{
- ChannelInfo chInfo;
+ ChannelInfo chInfo{};
try
{
getChannelInfo(channel, chInfo);