Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Suchanek <msuchanek@suse.de>2018-10-31 13:27:38 +0100
committerMichal Suchanek <msuchanek@suse.de>2018-10-31 23:28:43 +0100
commit767c61224e4ea1ed852e2924ae7ca58eb0261561 (patch)
tree972795b22f876bb407e9ade5fbdfca6245baade3
parent4f4e9dabebff09edec8e12c2d5264a2ba9b392b4 (diff)
KVM: PPC: Book3S HV: Add of_node_put() in success path
(bsc#1061840).
-rw-r--r--patches.arch/KVM-PPC-Book3S-HV-Add-of_node_put-in-success-path.patch39
-rw-r--r--series.conf1
2 files changed, 40 insertions, 0 deletions
diff --git a/patches.arch/KVM-PPC-Book3S-HV-Add-of_node_put-in-success-path.patch b/patches.arch/KVM-PPC-Book3S-HV-Add-of_node_put-in-success-path.patch
new file mode 100644
index 0000000000..6d35e7ea18
--- /dev/null
+++ b/patches.arch/KVM-PPC-Book3S-HV-Add-of_node_put-in-success-path.patch
@@ -0,0 +1,39 @@
+From 51eaa08f029c7343df846325d7cf047be8b96e81 Mon Sep 17 00:00:00 2001
+From: Nicholas Mc Guire <hofrat@osadl.org>
+Date: Sat, 7 Jul 2018 08:53:07 +0200
+Subject: [PATCH] KVM: PPC: Book3S HV: Add of_node_put() in success path
+
+References: bsc#1061840
+Patch-mainline: v4.19-rc1
+Git-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>
+Acked-by: Michal Suchanek <msuchanek@suse.de>
+---
+ arch/powerpc/kvm/book3s_hv.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c
+index de686b340f4a..fba21c91b2ff 100644
+--- a/arch/powerpc/kvm/book3s_hv.c
++++ b/arch/powerpc/kvm/book3s_hv.c
+@@ -4561,6 +4561,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
+
+--
+2.13.7
+
diff --git a/series.conf b/series.conf
index c1a086d38f..08a525471a 100644
--- a/series.conf
+++ b/series.conf
@@ -17779,6 +17779,7 @@
patches.drivers/dmaengine-pl330-fix-irq-race-with-terminate_all.patch
patches.drivers/Input-atmel_mxt_ts-only-use-first-T9-instance.patch
patches.arch/KVM-PPC-Book3S-Fix-matching-of-hardware-and-emulated.patch
+ patches.arch/KVM-PPC-Book3S-HV-Add-of_node_put-in-success-path.patch
patches.fixes/kvm-s390-add-etoken-support-for-guests.patch
patches.arch/kvm-nvmx-fix-fault-vector-for-vmx-operation-at-cpl-0
patches.arch/kvm-vmx-track-host_state-loaded-using-a-loaded_vmcs-pointer