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>
         */
        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;
                        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 */
        kvm_free_physmem_slot(&new, &old);
 out:
        return r;
-
 }
 EXPORT_SYMBOL_GPL(__kvm_set_memory_region);