Searched hist:"43 f6b0cfb2e4dfd5aa452a1d44491e805e37b7da" (Results 1 – 1 of 1) sorted by relevance
/openbmc/linux/arch/powerpc/kvm/ |
H A D | book3s_64_mmu_hv.c | diff 43f6b0cfb2e4dfd5aa452a1d44491e805e37b7da Thu Aug 31 05:51:09 CDT 2017 nixiaoming <nixiaoming@huawei.com> KVM: PPC: Book3S HV: Fix memory leak in kvm_vm_ioctl_get_htab_fd
We do ctx = kzalloc(sizeof(*ctx), GFP_KERNEL) and then later on call anon_inode_getfd(), but if that fails we don't free ctx, so that memory gets leaked. To fix it, this adds kfree(ctx) in the failure path.
Signed-off-by: nixiaoming <nixiaoming@huawei.com> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
|