aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/virt/kvm/arm/vgic/vgic-its.c
diff options
context:
space:
mode:
authorMarc Zyngier <maz@kernel.org>2020-04-23 16:27:33 +0100
committerMarc Zyngier <maz@kernel.org>2020-04-23 16:27:33 +0100
commit446c0768f5509793a0e527a439d4866b24707b0e (patch)
treeff8926db1a701b0276fb0deff6026956f632c961 /virt/kvm/arm/vgic/vgic-its.c
parentMerge branch 'kvm-arm64/psci-fixes-5.7' into kvmarm-master/master (diff)
parentKVM: arm64: vgic-its: Fix memory leak on the error path of vgic_add_lpi() (diff)
downloadwireguard-linux-446c0768f5509793a0e527a439d4866b24707b0e.tar.xz
wireguard-linux-446c0768f5509793a0e527a439d4866b24707b0e.zip
Merge branch 'kvm-arm64/vgic-fixes-5.7' into kvmarm-master/master
Diffstat (limited to 'virt/kvm/arm/vgic/vgic-its.c')
-rw-r--r--virt/kvm/arm/vgic/vgic-its.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/virt/kvm/arm/vgic/vgic-its.c b/virt/kvm/arm/vgic/vgic-its.c
index d53d34a33e35..c012a52b19f5 100644
--- a/virt/kvm/arm/vgic/vgic-its.c
+++ b/virt/kvm/arm/vgic/vgic-its.c
@@ -96,14 +96,21 @@ out_unlock:
* We "cache" the configuration table entries in our struct vgic_irq's.
* However we only have those structs for mapped IRQs, so we read in
* the respective config data from memory here upon mapping the LPI.
+ *
+ * Should any of these fail, behave as if we couldn't create the LPI
+ * by dropping the refcount and returning the error.
*/
ret = update_lpi_config(kvm, irq, NULL, false);
- if (ret)
+ if (ret) {
+ vgic_put_irq(kvm, irq);
return ERR_PTR(ret);
+ }
ret = vgic_v3_lpi_sync_pending_status(kvm, irq);
- if (ret)
+ if (ret) {
+ vgic_put_irq(kvm, irq);
return ERR_PTR(ret);
+ }
return irq;
}