UefiPayloadPkg: Bugfix: Do not parse NULL nodes

Not every node has compatible property; avoid parsing nodes
which return NULL.

Signed-off-by: Dhaval Sharma <dhaval@rivosinc.com>
This commit is contained in:
Dhaval 2024-08-29 14:39:26 +05:30 committed by mergify[bot]
parent ed665ef38c
commit 4d35077048

View File

@ -840,6 +840,8 @@ ParseDtb (
} // end of memory node
else {
PropertyPtr = FdtGetProperty (Fdt, Node, "compatible", &TempLen);
if (PropertyPtr == NULL)
continue;
TempStr = (CHAR8 *)(PropertyPtr->Data);
if (AsciiStrnCmp (TempStr, "pci-rb", AsciiStrLen ("pci-rb")) == 0) {
RootBridgeCount++;