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

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

 



On 2022/12/21 11:57, Tian, Kevin wrote:
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.

yes, no strict order here. maybe in the end.

--
Regards,
Yi Liu



[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