summaryrefslogtreecommitdiff
path: root/virt
diff options
context:
space:
mode:
authorTakuya Yoshikawa <yoshikawa_takuya_b1@lab.ntt.co.jp>2013-01-11 18:26:10 +0900
committerGleb Natapov <gleb@redhat.com>2013-01-17 14:27:43 +0200
commit0ea75e1d26dd4ccbbfe4d1a5931903b15b82ba2a (patch)
tree83aed7450eb5f2eea111a5da578e37285f6e065b /virt
parenta046b816a4587c7898772af7cc7e6798cc8b56dd (diff)
downloadlinux-stable-0ea75e1d26dd4ccbbfe4d1a5931903b15b82ba2a.tar.gz
linux-stable-0ea75e1d26dd4ccbbfe4d1a5931903b15b82ba2a.tar.bz2
linux-stable-0ea75e1d26dd4ccbbfe4d1a5931903b15b82ba2a.zip
KVM: set_memory_region: Don't jump to out_free unnecessarily
This makes the separation between the sanity checks and the rest of the code a bit clearer. Reviewed-by: Marcelo Tosatti <mtosatti@redhat.com> Signed-off-by: Takuya Yoshikawa <yoshikawa_takuya_b1@lab.ntt.co.jp> Signed-off-by: Gleb Natapov <gleb@redhat.com>
Diffstat (limited to 'virt')
-rw-r--r--virt/kvm/kvm_main.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index f689a6d7f9d4..28eb160fd487 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -778,9 +778,9 @@ int __kvm_set_memory_region(struct kvm *kvm,
*/
r = -EINVAL;
if (npages && old.npages && npages != old.npages)
- goto out_free;
+ goto out;
if (!npages && !old.npages)
- goto out_free;
+ goto out;
/* Check for overlaps */
r = -EEXIST;
@@ -789,7 +789,7 @@ int __kvm_set_memory_region(struct kvm *kvm,
continue;
if (!((base_gfn + npages <= slot->base_gfn) ||
(base_gfn >= slot->base_gfn + slot->npages)))
- goto out_free;
+ goto out;
}
/* Free page dirty bitmap if unneeded */
@@ -890,7 +890,6 @@ out_free:
kvm_free_physmem_slot(&new, &old);
out:
return r;
-
}
EXPORT_SYMBOL_GPL(__kvm_set_memory_region);