summaryrefslogtreecommitdiffstats
path: root/UefiPayloadPkg
diff options
context:
space:
mode:
authorDhaval <dhaval@rivosinc.com>2024-08-29 14:39:26 +0530
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2024-09-14 03:38:47 +0000
commit4d35077048eb5de182edf1ba5c4f253651190a02 (patch)
tree4e810c0de1acb9048eceb569b1a4163013d94090 /UefiPayloadPkg
parented665ef38ce9af6f05452b6a30f3258059b80f52 (diff)
downloadedk2-4d35077048eb5de182edf1ba5c4f253651190a02.tar.gz
edk2-4d35077048eb5de182edf1ba5c4f253651190a02.tar.bz2
edk2-4d35077048eb5de182edf1ba5c4f253651190a02.zip
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>
Diffstat (limited to 'UefiPayloadPkg')
-rw-r--r--UefiPayloadPkg/Library/FdtParserLib/FdtParserLib.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/UefiPayloadPkg/Library/FdtParserLib/FdtParserLib.c b/UefiPayloadPkg/Library/FdtParserLib/FdtParserLib.c
index 0ed7bc4810..76ff326ed8 100644
--- a/UefiPayloadPkg/Library/FdtParserLib/FdtParserLib.c
+++ b/UefiPayloadPkg/Library/FdtParserLib/FdtParserLib.c
@@ -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++;