Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 329005
b: refs/heads/master
c: 1d3653a
h: refs/heads/master
i:
  329003: 2c4e7f4
v: v3
  • Loading branch information
Al Viro committed Sep 27, 2012
1 parent 9435632 commit 8c0e2e0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8319aa9127a1282b24c3ece473a058d246f35b0d
refs/heads/master: 1d3653a79c4eedf5d6eaaa7328b1d134012b2509
8 changes: 4 additions & 4 deletions trunk/drivers/vfio/vfio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand All @@ -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;
}
Expand Down

0 comments on commit 8c0e2e0

Please sign in to comment.