diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-08-27 12:14:05 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-09-26 21:10:09 -0400 |
commit | 1d3653a79c4eedf5d6eaaa7328b1d134012b2509 (patch) | |
tree | 3514e79f7ccf9df3c3435e02cdb940c4dd6bbe79 /drivers/vfio | |
parent | 8319aa9127a1282b24c3ece473a058d246f35b0d (diff) | |
download | op-kernel-dev-1d3653a79c4eedf5d6eaaa7328b1d134012b2509.zip op-kernel-dev-1d3653a79c4eedf5d6eaaa7328b1d134012b2509.tar.gz |
switch vfio_group_set_container() to fget_light()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'drivers/vfio')
-rw-r--r-- | drivers/vfio/vfio.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/vfio/vfio.c b/drivers/vfio/vfio.c index 17830c9..91bcd97d 100644 --- a/drivers/vfio/vfio.c +++ b/drivers/vfio/vfio.c @@ -1017,18 +1017,18 @@ static int vfio_group_set_container(struct vfio_group *group, int container_fd) 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; } @@ -1054,7 +1054,7 @@ static int vfio_group_set_container(struct vfio_group *group, int container_fd) unlock_out: mutex_unlock(&container->group_lock); - fput(filep); + fput_light(filep, fput_needed); return ret; } |