* [PATCH] libkvm: x86: fix memleak if ioctl fails
@ 2009-07-13 8:27 Amit Shah
2009-07-13 8:38 ` Avi Kivity
0 siblings, 1 reply; 3+ messages in thread
From: Amit Shah @ 2009-07-13 8:27 UTC (permalink / raw)
To: avi; +Cc: kvm, Amit Shah
Fix a memleak for when the KVM_SET_CPUID2 ioctl fails. Free the
memory that we allocate to store cpuids.
Signed-off-by: Amit Shah <amit.shah@redhat.com>
---
kvm/libkvm/libkvm-x86.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/kvm/libkvm/libkvm-x86.c b/kvm/libkvm/libkvm-x86.c
index 9ca77d5..f1aef76 100644
--- a/kvm/libkvm/libkvm-x86.c
+++ b/kvm/libkvm/libkvm-x86.c
@@ -499,7 +499,7 @@ int kvm_setup_cpuid2(kvm_context_t kvm, int vcpu, int nent,
r = ioctl(kvm->vcpu_fd[vcpu], KVM_SET_CPUID2, cpuid);
if (r == -1) {
fprintf(stderr, "kvm_setup_cpuid2: %m\n");
- return -errno;
+ r = -errno;
}
free(cpuid);
return r;
--
1.6.2.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] libkvm: x86: fix memleak if ioctl fails
2009-07-13 8:27 [PATCH] libkvm: x86: fix memleak if ioctl fails Amit Shah
@ 2009-07-13 8:38 ` Avi Kivity
2009-07-13 8:41 ` Amit Shah
0 siblings, 1 reply; 3+ messages in thread
From: Avi Kivity @ 2009-07-13 8:38 UTC (permalink / raw)
To: Amit Shah; +Cc: kvm
On 07/13/2009 11:27 AM, Amit Shah wrote:
> Fix a memleak for when the KVM_SET_CPUID2 ioctl fails. Free the
> memory that we allocate to store cpuids.
>
>
Applied, thanks. Note that this libkvm is practically unused (the test
suite uses it but I want to move that to qemu -kernel).
--
error compiling committee.c: too many arguments to function
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] libkvm: x86: fix memleak if ioctl fails
2009-07-13 8:38 ` Avi Kivity
@ 2009-07-13 8:41 ` Amit Shah
0 siblings, 0 replies; 3+ messages in thread
From: Amit Shah @ 2009-07-13 8:41 UTC (permalink / raw)
To: Avi Kivity; +Cc: kvm
On (Mon) Jul 13 2009 [11:38:18], Avi Kivity wrote:
> On 07/13/2009 11:27 AM, Amit Shah wrote:
>> Fix a memleak for when the KVM_SET_CPUID2 ioctl fails. Free the
>> memory that we allocate to store cpuids.
>>
>>
>
> Applied, thanks. Note that this libkvm is practically unused (the test
> suite uses it but I want to move that to qemu -kernel).
I'll prepare a patch for qemu-kvm-x86.c.
Amit
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-07-13 8:41 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-13 8:27 [PATCH] libkvm: x86: fix memleak if ioctl fails Amit Shah
2009-07-13 8:38 ` Avi Kivity
2009-07-13 8:41 ` Amit Shah
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox