summaryrefslogtreecommitdiffstats
path: root/drivers/vfio
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2024-07-20 03:19:02 +0200
committerAl Viro <viro@zeniv.linux.org.uk>2024-11-03 07:28:06 +0100
commit8152f8201088350c76bb9685cd5990dd51d59aff (patch)
treed8c16f772fd79b751e19b29d420b6818239c94e6 /drivers/vfio
parentfdget(), trivial conversions (diff)
downloadlinux-8152f8201088350c76bb9685cd5990dd51d59aff.tar.xz
linux-8152f8201088350c76bb9685cd5990dd51d59aff.zip
fdget(), more trivial conversions
all failure exits prior to fdget() leave the scope, all matching fdput() are immediately followed by leaving the scope. [xfs_ioc_commit_range() chunk moved here as well] Reviewed-by: Christian Brauner <brauner@kernel.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'drivers/vfio')
-rw-r--r--drivers/vfio/group.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/vfio/group.c b/drivers/vfio/group.c
index 95b336de8a17..49559605177e 100644
--- a/drivers/vfio/group.c
+++ b/drivers/vfio/group.c
@@ -104,15 +104,14 @@ static int vfio_group_ioctl_set_container(struct vfio_group *group,
{
struct vfio_container *container;
struct iommufd_ctx *iommufd;
- struct fd f;
int ret;
int fd;
if (get_user(fd, arg))
return -EFAULT;
- f = fdget(fd);
- if (!fd_file(f))
+ CLASS(fd, f)(fd);
+ if (fd_empty(f))
return -EBADF;
mutex_lock(&group->group_lock);
@@ -153,7 +152,6 @@ static int vfio_group_ioctl_set_container(struct vfio_group *group,
out_unlock:
mutex_unlock(&group->group_lock);
- fdput(f);
return ret;
}