Commit 3c0ba05
KVM: x86: fix memoryleak in kvm_arch_vcpu_create()
When allocating memory for mci_ctl2_banks fails, KVM doesn't release
mce_banks leading to memoryleak. Fix this issue by calling kfree()
for it when kcalloc() fails.
Fixes: 281b527 ("KVM: x86: Add emulation for MSR_IA32_MCx_CTL2 MSRs.")
Signed-off-by: Miaohe Lin <[email protected]>
Message-Id: <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>1 parent 0204750 commit 3c0ba05
1 file changed
+1
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11580 | 11580 | | |
11581 | 11581 | | |
11582 | 11582 | | |
11583 | | - | |
| 11583 | + | |
11584 | 11584 | | |
11585 | 11585 | | |
11586 | 11586 | | |
| |||
11634 | 11634 | | |
11635 | 11635 | | |
11636 | 11636 | | |
11637 | | - | |
11638 | 11637 | | |
11639 | 11638 | | |
11640 | 11639 | | |
| |||
0 commit comments