]> xenbits.xensource.com Git - people/aperard/ovmf.git/commitdiff
UefiPayloadPkg: Bugfix: Do not parse NULL nodes
authorDhaval <dhaval@rivosinc.com>
Thu, 29 Aug 2024 09:09:26 +0000 (14:39 +0530)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Sat, 14 Sep 2024 03:38:47 +0000 (03:38 +0000)
Not every node has compatible property; avoid parsing nodes
which return NULL.

Signed-off-by: Dhaval Sharma <dhaval@rivosinc.com>
UefiPayloadPkg/Library/FdtParserLib/FdtParserLib.c

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