提交 458ff3c0 编写于 作者: G Gleb Natapov 提交者: Alexander Graf

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: NGleb Natapov <gleb@redhat.com>
Acked-by: NPaul Mackerras <paulus@samba.org>
Signed-off-by: NAlexander Graf <agraf@suse.de>
上级 398a76c6
...@@ -1246,8 +1246,10 @@ static int kvmppc_xics_create(struct kvm_device *dev, u32 type) ...@@ -1246,8 +1246,10 @@ static int kvmppc_xics_create(struct kvm_device *dev, u32 type)
kvm->arch.xics = xics; kvm->arch.xics = xics;
mutex_unlock(&kvm->lock); mutex_unlock(&kvm->lock);
if (ret) if (ret) {
kfree(xics);
return ret; return ret;
}
xics_debugfs_init(xics); xics_debugfs_init(xics);
......
...@@ -1635,6 +1635,7 @@ static void mpic_destroy(struct kvm_device *dev) ...@@ -1635,6 +1635,7 @@ static void mpic_destroy(struct kvm_device *dev)
dev->kvm->arch.mpic = NULL; dev->kvm->arch.mpic = NULL;
kfree(opp); kfree(opp);
kfree(dev);
} }
static int mpic_set_default_irq_routing(struct openpic *opp) static int mpic_set_default_irq_routing(struct openpic *opp)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册