Skip to content

Commit dc32e93

Browse files
jhovoldbjorn-helgaas
authored andcommitted
PCI/pwrctrl: Fix device leak at device stop
Make sure to drop the reference to the pwrctrl device taken by of_find_device_by_node() when stopping a PCI device. Fixes: 681725a ("PCI/pwrctl: Remove pwrctl device without iterating over all children of pwrctl parent") Signed-off-by: Johan Hovold <johan+linaro@kernel.org> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Reviewed-by: Manivannan Sadhasivam <mani@kernel.org> Cc: stable@vger.kernel.org # v6.13 Link: https://patch.msgid.link/20250721153609.8611-4-johan+linaro@kernel.org
1 parent e24bbbe commit dc32e93

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

drivers/pci/remove.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ static void pci_pwrctrl_unregister(struct device *dev)
3131
return;
3232

3333
of_device_unregister(pdev);
34+
put_device(&pdev->dev);
35+
3436
of_node_clear_flag(np, OF_POPULATED);
3537
}
3638

0 commit comments

Comments
 (0)