> 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.