diff options
| author | Jason Gunthorpe <jgg@nvidia.com> | 2021-03-30 18:53:05 +0300 |
|---|---|---|
| committer | Alex Williamson <alex.williamson@redhat.com> | 2021-04-06 20:55:09 +0300 |
| commit | e572bfb2b6a83b05acd30c03010e661b1967960f (patch) | |
| tree | ce502bbb103ee1cc53e621e6c7dc13f9929a4e1d /lib/mpi/mpi-div.c | |
| parent | e49d033bddf5b565044e2abe4241353959bc9120 (diff) | |
| download | linux-e572bfb2b6a83b05acd30c03010e661b1967960f.tar.xz | |
vfio: Remove extra put/gets around vfio_device->group
The vfio_device->group value has a get obtained during
vfio_add_group_dev() which gets moved from the stack to vfio_device->group
in vfio_group_create_device().
The reference remains until we reach the end of vfio_del_group_dev() when
it is put back.
Thus anything that already has a kref on the vfio_device is guaranteed a
valid group pointer. Remove all the extra reference traffic.
It is tricky to see, but the get at the start of vfio_del_group_dev() is
actually pairing with the put hidden inside vfio_device_put() a few lines
below.
A later patch merges vfio_group_create_device() into vfio_add_group_dev()
which makes the ownership and error flow on the create side easier to
follow.
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Reviewed-by: Max Gurtovoy <mgurtovoy@nvidia.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Message-Id: <1-v3-225de1400dfc+4e074-vfio1_jgg@nvidia.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Diffstat (limited to 'lib/mpi/mpi-div.c')
0 files changed, 0 insertions, 0 deletions
