summaryrefslogtreecommitdiff
path: root/virt/kvm
diff options
context:
space:
mode:
authorGuo Chao <yan@linux.vnet.ibm.com>2012-11-02 10:33:21 (GMT)
committerMarcelo Tosatti <mtosatti@redhat.com>2012-11-14 00:14:28 (GMT)
commit18595411a7146330ec19adf0b9db8e6736c84a4e (patch)
treee92309d75edc34d48830b5d7712876a03dbde5c0 /virt/kvm
parentf026399fc90655ac444c62139aa4f8a02e1c795a (diff)
downloadlinux-18595411a7146330ec19adf0b9db8e6736c84a4e.tar.xz
KVM: do not kfree error pointer
We should avoid kfree()ing error pointer in kvm_vcpu_ioctl() and kvm_arch_vcpu_ioctl(). Signed-off-by: Guo Chao <yan@linux.vnet.ibm.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'virt/kvm')
-rw-r--r--virt/kvm/kvm_main.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index 2fb7319..316d76a 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -1954,6 +1954,7 @@ out_free2:
kvm_sregs = memdup_user(argp, sizeof(*kvm_sregs));
if (IS_ERR(kvm_sregs)) {
r = PTR_ERR(kvm_sregs);
+ kvm_sregs = NULL;
goto out;
}
r = kvm_arch_vcpu_ioctl_set_sregs(vcpu, kvm_sregs);
@@ -2054,6 +2055,7 @@ out_free2:
fpu = memdup_user(argp, sizeof(*fpu));
if (IS_ERR(fpu)) {
r = PTR_ERR(fpu);
+ fpu = NULL;
goto out;
}
r = kvm_arch_vcpu_ioctl_set_fpu(vcpu, fpu);