PCI: of: Destroy changeset when adding PCI device node fails
authorLizhi Hou <lizhi.hou@amd.com>
Fri, 29 Sep 2023 17:10:17 +0000 (10:10 -0700)
committerBjorn Helgaas <bhelgaas@google.com>
Fri, 29 Sep 2023 22:33:51 +0000 (17:33 -0500)
commitf69977404700a3d33b1c4b492c2a44f17cb07af5
tree4fbb9ea726173d56c97563b0aeffe0d5e44abffd
parent33efa29e825636a06d5711c9dfccf92726d2fc81
PCI: of: Destroy changeset when adding PCI device node fails

Previously of_pci_make_dev_node() leaked a cset if it failed to create a
device node for the PCI device with of_changeset_create_node().

Destroy the cset if of_changeset_create_node() fails.

Fixes: 407d1a51921e ("PCI: Create device tree node for bridge")
Link: https://lore.kernel.org/r/1696007417-42059-1-git-send-email-lizhi.hou@amd.com
Reported-by: Herve Codina <herve.codina@bootlin.com>
Closes: https://lore.kernel.org/all/20230911171319.495bb837@bootlin.com/
Signed-off-by: Lizhi Hou <lizhi.hou@amd.com>
[bhelgaas: commit log]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Herve Codina <herve.codina@bootlin.com>
drivers/pci/of.c