mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
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 <[email protected]> Signed-off-by: Marcelo Tosatti <[email protected]>
This commit is contained in:
parent
f026399fc9
commit
18595411a7
2 changed files with 8 additions and 13 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue