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>
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user