diff options
author | Jason Gunthorpe <jgg@nvidia.com> | 2021-03-30 09:53:06 -0600 |
---|---|---|
committer | Alex Williamson <alex.williamson@redhat.com> | 2021-04-06 11:55:10 -0600 |
commit | 61e90817482871b614133c0f20feb1aba2faec86 (patch) | |
tree | ca022677fb79a01580f780fe92c3c9de84b7a526 /drivers/thermal | |
parent | 0ca78666fa06cf2a7d068a593428dc4039706e00 (diff) |
vfio/pci: Move VGA and VF initialization to functions
vfio_pci_probe() is quite complicated, with optional VF and VGA sub
components. Move these into clear init/uninit functions and have a linear
flow in probe/remove.
This fixes a few little buglets:
- vfio_pci_remove() is in the wrong order, vga_client_register() removes
a notifier and is after kfree(vdev), but the notifier refers to vdev,
so it can use after free in a race.
- vga_client_register() can fail but was ignored
Organize things so destruction order is the reverse of creation order.
Fixes: ecaa1f6a0154 ("vfio-pci: Add VGA arbiter client")
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: <7-v3-225de1400dfc+4e074-vfio1_jgg@nvidia.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Diffstat (limited to 'drivers/thermal')
0 files changed, 0 insertions, 0 deletions