]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
PCI: brcmstb: Fix missing of_node_put() in brcm_pcie_probe()
authorStanimir Varbanov <svarbanov@suse.de>
Wed, 22 Jan 2025 22:29:55 +0000 (00:29 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 20 Apr 2025 08:15:57 +0000 (10:15 +0200)
commit71bf0769a6c63b6f2e2774a5b7eef8af854a89f1
tree9e66643382bf7d1644a8ce7d7b3eacdb93cb749e
parent712d84459a53fc78f36ef44967f4cde4623b38f6
PCI: brcmstb: Fix missing of_node_put() in brcm_pcie_probe()

commit 2df181e1aea4628a8fd257f866026625d0519627 upstream.

A call to of_parse_phandle() is incrementing the refcount, and as such,
the of_node_put() must be called when the reference is no longer needed.

Thus, refactor the existing code and add a missing of_node_put() call
following the check to ensure that "msi_np" matches "pcie->np" and after
MSI initialization, but only if the MSI support is enabled system-wide.

Cc: stable@vger.kernel.org # v5.10+
Fixes: 40ca1bf580ef ("PCI: brcmstb: Add MSI support")
Signed-off-by: Stanimir Varbanov <svarbanov@suse.de>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Link: https://lore.kernel.org/r/20250122222955.1752778-1-svarbanov@suse.de
[kwilczynski: commit log]
Signed-off-by: Krzysztof WilczyƄski <kwilczynski@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/pci/controller/pcie-brcmstb.c