]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
KVM: PPC: Book3S HV: Add of_node_put() in success path
authorNicholas Mc Guire <hofrat@osadl.org>
Sat, 7 Jul 2018 06:53:07 +0000 (08:53 +0200)
committerJuerg Haefliger <juergh@canonical.com>
Wed, 24 Jul 2019 01:49:09 +0000 (19:49 -0600)
BugLink: https://bugs.launchpad.net/bugs/1836117
[ Upstream commit 51eaa08f029c7343df846325d7cf047be8b96e81 ]

The call to of_find_compatible_node() is returning a pointer with
incremented refcount so it must be explicitly decremented after the
last use. As here it is only being used for checking of node presence
but the result is not actually used in the success path it can be
dropped immediately.

Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
Fixes: commit f725758b899f ("KVM: PPC: Book3S HV: Use OPAL XICS emulation on POWER9")
Signed-off-by: Paul Mackerras <paulus@ozlabs.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/powerpc/kvm/book3s_hv.c

index 61a907d11edbd65cbecffc98a10bb7b5ddbbf9e2..6c3322c7058f8b821c30e175be8e8df55450bc4c 100644 (file)
@@ -4479,6 +4479,8 @@ static int kvmppc_book3s_init_hv(void)
                        pr_err("KVM-HV: Cannot determine method for accessing XICS\n");
                        return -ENODEV;
                }
+               /* presence of intc confirmed - node can be dropped again */
+               of_node_put(np);
        }
 #endif