vfio: fix possible use after free of vfio group

The vfio group should be released after
the vfio_group_try_dissolve_container call.
The code should not rely on someone else to hold
a reference on the group.

Signed-off-by: Ilya Lesokhin <ilyal@mellanox.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
This commit is contained in:
Ilya Lesokhin 2016-07-14 16:50:19 +03:00 committed by Alex Williamson
parent 05f0c03fba
commit d370c917b9

View file

@ -1711,8 +1711,8 @@ EXPORT_SYMBOL_GPL(vfio_group_get_external_user);
void vfio_group_put_external_user(struct vfio_group *group)
{
vfio_group_put(group);
vfio_group_try_dissolve_container(group);
vfio_group_put(group);
}
EXPORT_SYMBOL_GPL(vfio_group_put_external_user);