diff options
author | Jason Gunthorpe <[email protected]> | 2021-10-15 08:40:52 -0300 |
---|---|---|
committer | Alex Williamson <[email protected]> | 2021-10-15 13:58:20 -0600 |
commit | 325a31c920309d2225311573a05c2f4dd402b2ed (patch) | |
tree | 907abc48d414c4f0b1ab4cef209b417bfce05a72 /drivers/usb/cdns3/cdns3-trace.c | |
parent | 1ceabade1df78c420e30efd4d39a48ceb46487bc (diff) |
vfio: Don't leak a group reference if the group already exists
If vfio_create_group() searches the group list and returns an already
existing group it does not put back the iommu_group reference that the
caller passed in.
Change the semantic of vfio_create_group() to not move the reference in
from the caller, but instead obtain a new reference inside and leave the
caller's reference alone. The two callers must now call iommu_group_put().
This is an unlikely race as the only caller that could hit it has already
searched the group list before attempting to create the group.
Fixes: cba3345cc494 ("vfio: VFIO core")
Reviewed-by: Christoph Hellwig <[email protected]>
Reviewed-by: Kevin Tian <[email protected]>
Signed-off-by: Jason Gunthorpe <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alex Williamson <[email protected]>
Diffstat (limited to 'drivers/usb/cdns3/cdns3-trace.c')
0 files changed, 0 insertions, 0 deletions