Platform/Intel/AdvancedFeaturePkg/Ipmi/BmcElog/BmcElog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Change the value from "sizeof(UINT8)" to 1 in the arithmetic expression.
The original value added to (UINT8 *)&GetBmcGlobalEnables is
(sizeof(UINT8)*sizeof(UINT8)) which equals to 1, so the functionality
looks right. But the arithmetic logic is actually wrong.
Cc: Michael Kubacki <michael.a.kubacki@intel.com>
Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com>
---
Platform/Intel/AdvancedFeaturePkg/Ipmi/BmcElog/BmcElog.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Platform/Intel/AdvancedFeaturePkg/Ipmi/BmcElog/BmcElog.c b/Platform/Intel/AdvancedFeaturePkg/Ipmi/BmcElog/BmcElog.c
index 421fbdec..beaa3fa0 100644
--- a/Platform/Intel/AdvancedFeaturePkg/Ipmi/BmcElog/BmcElog.c
+++ b/Platform/Intel/AdvancedFeaturePkg/Ipmi/BmcElog/BmcElog.c
@@ -131,7 +131,7 @@ Returns:
ElogStat = 1;
}
- CopyMem (&SetBmcGlobalEnables, (UINT8 *)&GetBmcGlobalEnables + sizeof(UINT8), sizeof(UINT8));
+ CopyMem (&SetBmcGlobalEnables, (UINT8 *)&GetBmcGlobalEnables + 1, sizeof(UINT8));
SetBmcGlobalEnables.SetEnables.Bits.SystemEventLogging = ElogStat;
Status = IpmiSetBmcGlobalEnables (&SetBmcGlobalEnables, &CompletionCode);
--
2.18.0.windows.1
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#46665): https://edk2.groups.io/g/devel/message/46665
Mute This Topic: https://groups.io/mt/33110327/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
Reviewed-by: Liming Gao <liming.gao@intel.com> >-----Original Message----- >From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of >Zhang, Shenglei >Sent: Monday, September 02, 2019 8:05 PM >To: devel@edk2.groups.io >Cc: Kubacki, Michael A <michael.a.kubacki@intel.com>; Chaganty, Rangasai V ><rangasai.v.chaganty@intel.com>; Gao, Liming <liming.gao@intel.com> >Subject: [edk2-devel] [PATCH] AdvancedFeaturePkg/BmcElog: Change >arithmetic logic > >Change the value from "sizeof(UINT8)" to 1 in the arithmetic expression. >The original value added to (UINT8 *)&GetBmcGlobalEnables is >(sizeof(UINT8)*sizeof(UINT8)) which equals to 1, so the functionality >looks right. But the arithmetic logic is actually wrong. > >Cc: Michael Kubacki <michael.a.kubacki@intel.com> >Cc: Sai Chaganty <rangasai.v.chaganty@intel.com> >Cc: Liming Gao <liming.gao@intel.com> >Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com> >--- > Platform/Intel/AdvancedFeaturePkg/Ipmi/BmcElog/BmcElog.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > >diff --git a/Platform/Intel/AdvancedFeaturePkg/Ipmi/BmcElog/BmcElog.c >b/Platform/Intel/AdvancedFeaturePkg/Ipmi/BmcElog/BmcElog.c >index 421fbdec..beaa3fa0 100644 >--- a/Platform/Intel/AdvancedFeaturePkg/Ipmi/BmcElog/BmcElog.c >+++ b/Platform/Intel/AdvancedFeaturePkg/Ipmi/BmcElog/BmcElog.c >@@ -131,7 +131,7 @@ Returns: > ElogStat = 1; > } > >- CopyMem (&SetBmcGlobalEnables, (UINT8 *)&GetBmcGlobalEnables + >sizeof(UINT8), sizeof(UINT8)); >+ CopyMem (&SetBmcGlobalEnables, (UINT8 *)&GetBmcGlobalEnables + 1, >sizeof(UINT8)); > SetBmcGlobalEnables.SetEnables.Bits.SystemEventLogging = ElogStat; > > Status = IpmiSetBmcGlobalEnables (&SetBmcGlobalEnables, >&CompletionCode); >-- >2.18.0.windows.1 > > > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#47254): https://edk2.groups.io/g/devel/message/47254 Mute This Topic: https://groups.io/mt/33110327/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=-=-=-=-=-=-=-=-=-=-=-
The structure ClearSelResponse is uninitialized before used.
Cc: Michael Kubacki <michael.a.kubacki@intel.com>
Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
Cc: Liming Gao <liming.gao@intel.com>
Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com>
---
Platform/Intel/AdvancedFeaturePkg/Ipmi/BmcElog/BmcElog.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/Platform/Intel/AdvancedFeaturePkg/Ipmi/BmcElog/BmcElog.c b/Platform/Intel/AdvancedFeaturePkg/Ipmi/BmcElog/BmcElog.c
index 421fbdec..73373534 100644
--- a/Platform/Intel/AdvancedFeaturePkg/Ipmi/BmcElog/BmcElog.c
+++ b/Platform/Intel/AdvancedFeaturePkg/Ipmi/BmcElog/BmcElog.c
@@ -59,6 +59,7 @@ Returns:
IPMI_CLEAR_SEL_RESPONSE ClearSelResponse;
Counter = 0x200;
+ ZeroMem (&ClearSelResponse, sizeof(ClearSelResponse));
while (TRUE) {
ZeroMem (&ClearSel, sizeof(ClearSel));
--
2.18.0.windows.1
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#46666): https://edk2.groups.io/g/devel/message/46666
Mute This Topic: https://groups.io/mt/33110328/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
Reviewed-by: Liming Gao <liming.gao@intel.com> >-----Original Message----- >From: devel@edk2.groups.io [mailto:devel@edk2.groups.io] On Behalf Of >Zhang, Shenglei >Sent: Monday, September 02, 2019 8:05 PM >To: devel@edk2.groups.io >Cc: Kubacki, Michael A <michael.a.kubacki@intel.com>; Chaganty, Rangasai V ><rangasai.v.chaganty@intel.com>; Gao, Liming <liming.gao@intel.com> >Subject: [edk2-devel] [PATCH] AdvancedFeaturePkg/BmcElog: Initialize >ClearSelResponse > >The structure ClearSelResponse is uninitialized before used. > >Cc: Michael Kubacki <michael.a.kubacki@intel.com> >Cc: Sai Chaganty <rangasai.v.chaganty@intel.com> >Cc: Liming Gao <liming.gao@intel.com> >Signed-off-by: Shenglei Zhang <shenglei.zhang@intel.com> >--- > Platform/Intel/AdvancedFeaturePkg/Ipmi/BmcElog/BmcElog.c | 1 + > 1 file changed, 1 insertion(+) > >diff --git a/Platform/Intel/AdvancedFeaturePkg/Ipmi/BmcElog/BmcElog.c >b/Platform/Intel/AdvancedFeaturePkg/Ipmi/BmcElog/BmcElog.c >index 421fbdec..73373534 100644 >--- a/Platform/Intel/AdvancedFeaturePkg/Ipmi/BmcElog/BmcElog.c >+++ b/Platform/Intel/AdvancedFeaturePkg/Ipmi/BmcElog/BmcElog.c >@@ -59,6 +59,7 @@ Returns: > IPMI_CLEAR_SEL_RESPONSE ClearSelResponse; > > Counter = 0x200; >+ ZeroMem (&ClearSelResponse, sizeof(ClearSelResponse)); > > while (TRUE) { > ZeroMem (&ClearSel, sizeof(ClearSel)); >-- >2.18.0.windows.1 > > > -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#47255): https://edk2.groups.io/g/devel/message/47255 Mute This Topic: https://groups.io/mt/33110328/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=-=-=-=-=-=-=-=-=-=-=-
© 2016 - 2024 Red Hat, Inc.