From dfdba857a6b6a708e754ddb1a04086a3402acdef Mon Sep 17 00:00:00 2001 From: James Lu Date: Tue, 23 Aug 2022 11:13:55 +0800 Subject: 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 Reviewed-by: Guo Dong Reviewed-by: James Lu --- UefiPayloadPkg/Library/PciHostBridgeLib/PciHostBridgeLib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'UefiPayloadPkg/Library') 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; -- cgit v1.2.3