Re: [PATCH v6 14/22] KVM: Clean up local variable usage in __kvm_set_memory_region()

Paolo Bonzini
2020-02-21T17:43:47Z

On 18/02/20 22:07, Sean Christopherson wrote:
> -sorted by update_memslots(), and the old
> * memslot needs to be referenced after calling update_memslots(), e.g.
> - * to free its resources and for arch specific behavior.
> + * to free its resources and for arch specific behavior. Kill @tmp
> + * after making a copy to deter potentially dangerous usage.
> */
> - old = *slot;
> + tmp = id_to_memslot(__kvm_memslots(kvm, as_id), id);
> + old = *tmp;
> + tmp = NULL;
> +

Also: old = *id_to_memslot(...).

Paolo