Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 458ff3c0 authored by Gleb Natapov's avatar Gleb Natapov Committed by Alexander Graf
Browse files

KVM: PPC: fix couple of memory leaks in MPIC/XICS devices



XICS failed to free xics structure on error path. MPIC destroy handler
forgot to delete kvm_device structure.

Signed-off-by: default avatarGleb Natapov <gleb@redhat.com>
Acked-by: default avatarPaul Mackerras <paulus@samba.org>
Signed-off-by: default avatarAlexander Graf <agraf@suse.de>
parent 398a76c6
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -1246,8 +1246,10 @@ static int kvmppc_xics_create(struct kvm_device *dev, u32 type)
		kvm->arch.xics = xics;
	mutex_unlock(&kvm->lock);

	if (ret)
	if (ret) {
		kfree(xics);
		return ret;
	}

	xics_debugfs_init(xics);

+1 −0
Original line number Diff line number Diff line
@@ -1635,6 +1635,7 @@ static void mpic_destroy(struct kvm_device *dev)

	dev->kvm->arch.mpic = NULL;
	kfree(opp);
	kfree(dev);
}

static int mpic_set_default_irq_routing(struct openpic *opp)