Re: [RFC PATCH 1/3] kvm: arm/arm64: vgic-vits: separate vgic_its_free_list() function

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

 



On 2017/9/6 21:05, wanghaibin wrote:

> We slightly refactor vgic_its_destroy, separate vgic_its_free_list()
> function for later patch invoke.
> 
> The patch also take a functional change. If the its->device_list.next
> is NULL, we still should free the its.


Hi, Eric

Does this its->device_list.next is NULL can happened ?

Thanks

> Honestly, I can't understand How does the its->device_list.next is NULL
> happened at this moment.
> 
> Signed-off-by: wanghaibin <wanghaibin.wang@xxxxxxxxxx>
> ---
>  virt/kvm/arm/vgic/vgic-its.c | 11 ++++++++---
>  1 file changed, 8 insertions(+), 3 deletions(-)
> 
> diff --git a/virt/kvm/arm/vgic/vgic-its.c b/virt/kvm/arm/vgic/vgic-its.c
> index aa6b68d..25d614f 100644
> --- a/virt/kvm/arm/vgic/vgic-its.c
> +++ b/virt/kvm/arm/vgic/vgic-its.c
> @@ -1624,10 +1624,8 @@ static void vgic_its_free_device(struct kvm *kvm, struct its_device *dev)
>  	kfree(dev);
>  }
>  
> -static void vgic_its_destroy(struct kvm_device *kvm_dev)
> +static void vgic_its_free_list(struct kvm *kvm, struct vgic_its *its)
>  {
> -	struct kvm *kvm = kvm_dev->kvm;
> -	struct vgic_its *its = kvm_dev->private;
>  	struct list_head *cur, *temp;
>  
>  	/*
> @@ -1653,7 +1651,14 @@ static void vgic_its_destroy(struct kvm_device *kvm_dev)
>  		kfree(coll);
>  	}
>  	mutex_unlock(&its->its_lock);
> +}
> +
> +static void vgic_its_destroy(struct kvm_device *kvm_dev)
> +{
> +	struct kvm *kvm = kvm_dev->kvm;
> +	struct vgic_its *its = kvm_dev->private;
>  
> +	vgic_its_free_list(kvm, its);
>  	kfree(its);
>  }
>  



_______________________________________________
kvmarm mailing list
kvmarm@xxxxxxxxxxxxxxxxxxxxx
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm



[Index of Archives]     [Linux KVM]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux