struct file *filep;
struct vfio_container *container;
struct vfio_iommu_driver *driver;
- int ret = 0;
+ int ret = 0, fput_needed;
if (atomic_read(&group->container_users))
return -EINVAL;
- filep = fget(container_fd);
+ filep = fget_light(container_fd, &fput_needed);
if (!filep)
return -EBADF;
/* Sanity check, is this really our fd? */
if (filep->f_op != &vfio_fops) {
- fput(filep);
+ fput_light(filep, fput_needed);
return -EINVAL;
}
unlock_out:
mutex_unlock(&container->group_lock);
- fput(filep);
+ fput_light(filep, fput_needed);
return ret;
}