RE: [RFC 01/12] vfio: Allocate per device file structure

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

 



> From: Liu, Yi L <yi.l.liu@xxxxxxxxx>
> Sent: Monday, December 19, 2022 4:47 PM
>
>  static int vfio_device_fops_release(struct inode *inode, struct file *filep)
>  {
> -	struct vfio_device *device = filep->private_data;
> +	struct vfio_device_file *df = filep->private_data;
> +	struct vfio_device *device = df->device;
> 
>  	vfio_device_group_close(device);
> -
> +	kfree(df);
>  	vfio_device_put_registration(device);

Why putting kfree() in between the two invocations? There is no
strict order requirement of doing so. It reads slightly better to
free df either in the start or in the end.




[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