summaryrefslogtreecommitdiffstats
path: root/UefiPayloadPkg/Library
diff options
context:
space:
mode:
authorJames Lu <james.lu@intel.com>2022-08-23 11:13:55 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2022-08-23 04:03:01 +0000
commitdfdba857a6b6a708e754ddb1a04086a3402acdef (patch)
tree42560818974e60d050329d0701a1d2d31fe0e78b /UefiPayloadPkg/Library
parentf2bf043aaac7107a8ed1c0060c838d1e032e077f (diff)
downloadedk2-dfdba857a6b6a708e754ddb1a04086a3402acdef.tar.gz
edk2-dfdba857a6b6a708e754ddb1a04086a3402acdef.tar.bz2
edk2-dfdba857a6b6a708e754ddb1a04086a3402acdef.zip
UefiPayloadPkg: Fix Coverity report defect
https://bugzilla.tianocore.org/show_bug.cgi?id=4018 Coverity report FORWARD_NULL and OVERFLOW_BEFORE_WIDEN potential defect in UefiPayloadPkg. Signed-off-by: Gregx Yeh <gregx.yeh@intel.com> Reviewed-by: Guo Dong <guo.dong@intel.com> Reviewed-by: James Lu <james.lu@intel.com>
Diffstat (limited to 'UefiPayloadPkg/Library')
-rw-r--r--UefiPayloadPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/UefiPayloadPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c b/UefiPayloadPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c
index 9847063d3d..790e6109c0 100644
--- a/UefiPayloadPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c
+++ b/UefiPayloadPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c
@@ -232,11 +232,11 @@ PciHostBridgeFreeRootBridges (
UINTN Count
)
{
- if ((Bridges == NULL) && (Count == 0)) {
+ if ((Bridges == NULL) || (Count == 0)) {
return;
}
- ASSERT (Bridges != NULL && Count > 0);
+ ASSERT (Bridges != NULL || Count > 0);
do {
--Count;