@@ -3990,6 +3990,9 @@ static int of_unittest_pci_node_verify(struct pci_dev *pdev, bool add)
if (add) {
path = kasprintf(GFP_KERNEL, "%pOF/pci-ep-bus@0/unittest-pci@100", pnp);
+ if (!path)
+ return -ENOMEM;
+
np = of_find_node_by_path(path);
unittest(np, "Failed to get unittest-pci node under PCI node\n");
if (!np) {
@@ -4003,6 +4006,9 @@ static int of_unittest_pci_node_verify(struct pci_dev *pdev, bool add)
rc = -ENODEV;
} else {
path = kasprintf(GFP_KERNEL, "%pOF/pci-ep-bus@0", pnp);
+ if (!path)
+ return -ENOMEM;
+
np = of_find_node_by_path(path);
unittest(!np, "Child device tree node is not removed\n");
child_dev = device_find_any_child(&pdev->dev);