summaryrefslogtreecommitdiffstats
path: root/virt
diff options
context:
space:
mode:
authorChristian Borntraeger <borntraeger@de.ibm.com>2014-09-04 21:13:33 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2014-09-05 12:01:15 +0200
commitf2a25160887e00434ce1361007009120e1fecbda (patch)
tree1eaa0d6d07eceda78a312be14c9459629560890b /virt
parenta13f533b2f1d53a7c0baa7490498caeab7bc8ba5 (diff)
downloadop-kernel-dev-f2a25160887e00434ce1361007009120e1fecbda.zip
op-kernel-dev-f2a25160887e00434ce1361007009120e1fecbda.tar.gz
KVM: remove redundant assignments in __kvm_set_memory_region
__kvm_set_memory_region sets r to EINVAL very early. Doing it again is not necessary. The same is true later on, where r is assigned -ENOMEM twice. Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'virt')
-rw-r--r--virt/kvm/kvm_main.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index de1ae82..c338599 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -793,7 +793,6 @@ int __kvm_set_memory_region(struct kvm *kvm,
base_gfn = mem->guest_phys_addr >> PAGE_SHIFT;
npages = mem->memory_size >> PAGE_SHIFT;
- r = -EINVAL;
if (npages > KVM_MEM_MAX_NR_PAGES)
goto out;
@@ -807,7 +806,6 @@ int __kvm_set_memory_region(struct kvm *kvm,
new.npages = npages;
new.flags = mem->flags;
- r = -EINVAL;
if (npages) {
if (!old.npages)
change = KVM_MR_CREATE;
@@ -863,7 +861,6 @@ int __kvm_set_memory_region(struct kvm *kvm,
}
if ((change == KVM_MR_DELETE) || (change == KVM_MR_MOVE)) {
- r = -ENOMEM;
slots = kmemdup(kvm->memslots, sizeof(struct kvm_memslots),
GFP_KERNEL);
if (!slots)
OpenPOWER on IntegriCloud