提交 ba60c41a 编写于 作者: S Sudip Mukherjee 提交者: Paolo Bonzini

kvm: irqchip: fix memory leak

We were taking the exit path after checking ue->flags and return value
of setup_routing_entry(), but 'e' was not freed incase of a failure.
Signed-off-by: NSudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
上级 3dfe6a50
......@@ -213,11 +213,15 @@ int kvm_set_irq_routing(struct kvm *kvm,
goto out;
r = -EINVAL;
if (ue->flags)
if (ue->flags) {
kfree(e);
goto out;
}
r = setup_routing_entry(new, e, ue);
if (r)
if (r) {
kfree(e);
goto out;
}
++ue;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册