Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 322092
b: refs/heads/master
c: 6d2cd3c
h: refs/heads/master
v: v3
  • Loading branch information
Al Viro committed Aug 22, 2012
1 parent 1710876 commit c9397c7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 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: 8ad5db8a8ddbe3bd33078863a027011e28f1f4ee
refs/heads/master: 6d2cd3ce815b302e885b44ca1bdbe3c7db321c7a
9 changes: 2 additions & 7 deletions trunk/drivers/vfio/vfio.c
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ static struct vfio_group *vfio_create_group(struct iommu_group *iommu_group)
return group;
}

/* called with vfio.group_lock held */
static void vfio_group_release(struct kref *kref)
{
struct vfio_group *group = container_of(kref, struct vfio_group, kref);
Expand All @@ -287,13 +288,7 @@ static void vfio_group_release(struct kref *kref)

static void vfio_group_put(struct vfio_group *group)
{
mutex_lock(&vfio.group_lock);
/*
* Release needs to unlock to unregister the notifier, so only
* unlock if not released.
*/
if (!kref_put(&group->kref, vfio_group_release))
mutex_unlock(&vfio.group_lock);
kref_put_mutex(&group->kref, vfio_group_release, &vfio.group_lock);
}

/* Assume group_lock or group reference is held */
Expand Down

0 comments on commit c9397c7

Please sign in to comment.