projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3dfe6a5
)
kvm: irqchip: fix memory leak
author
Sudip Mukherjee
<sudipm.mukherjee@gmail.com>
Wed, 2 Sep 2015 07:03:53 +0000
(12:33 +0530)
committer
Paolo Bonzini
<pbonzini@redhat.com>
Tue, 8 Sep 2015 09:16:41 +0000
(11:16 +0200)
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: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
virt/kvm/irqchip.c
patch
|
blob
|
history
diff --git
a/virt/kvm/irqchip.c
b/virt/kvm/irqchip.c
index 21c14244f4c4fd1c3c8ffade7f3265df91c89efb..d7ea8e20dae4ee9b353441e5e342a6279d1485d6 100644
(file)
--- a/
virt/kvm/irqchip.c
+++ b/
virt/kvm/irqchip.c
@@
-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;
}