Re: [1/1] KVM: restrict kvm_gfn_to_hva_cache_init() to only accept address ranges within one page

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> +	if (likely(nr_pages_needed == 1))
> +		return __kvm_gfn_to_hva_cache_init(slots, ghc, gpa, len);
> +	else
> +		return -EINVAL;
>  }

I don't really have enough knowledge to comment on the functionality,
but this code structure is really odd to read.

Try to handle error conditions with early returns first, please:

	if (unlikely(nr_pages_needed != 1))
		return -EINVAL;
	return __kvm_gfn_to_hva_cache_init(slots, ghc, gpa, len);




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux