]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
MIPS: Octeon: add missing of_node_put()
authorNicholas Mc Guire <hofrat@osadl.org>
Sat, 16 Jun 2018 07:06:33 +0000 (09:06 +0200)
committerJuerg Haefliger <juergh@canonical.com>
Wed, 24 Jul 2019 01:47:49 +0000 (19:47 -0600)
BugLink: https://bugs.launchpad.net/bugs/1836117
[ Upstream commit b1259519e618d479ede8a0db5474b3aff99f5056 ]

The call to of_find_node_by_name returns a node pointer with refcount
incremented thus it must be explicitly decremented here after the last
usage.

Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Signed-off-by: Paul Burton <paul.burton@mips.com>
Patchwork: https://patchwork.linux-mips.org/patch/19558/
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: James Hogan <jhogan@kernel.org>
Cc: linux-mips@linux-mips.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
arch/mips/cavium-octeon/octeon-platform.c

index 8505db478904b10855eabf266f75ff9dd93e3699..1d92efb82c3729173e01d64b660f961bc42dd9b8 100644 (file)
@@ -322,6 +322,7 @@ static int __init octeon_ehci_device_init(void)
                return 0;
 
        pd = of_find_device_by_node(ehci_node);
+       of_node_put(ehci_node);
        if (!pd)
                return 0;
 
@@ -384,6 +385,7 @@ static int __init octeon_ohci_device_init(void)
                return 0;
 
        pd = of_find_device_by_node(ohci_node);
+       of_node_put(ohci_node);
        if (!pd)
                return 0;