]> git.baikalelectronics.ru Git - kernel.git/commit
vfio-pci: Fix remove path locking
authorAlex Williamson <alex.williamson@redhat.com>
Mon, 29 Sep 2014 23:18:39 +0000 (17:18 -0600)
committerAlex Williamson <alex.williamson@redhat.com>
Mon, 29 Sep 2014 23:18:39 +0000 (17:18 -0600)
commit5430be68c657d60fcc384718f1bbb31befc822c3
tree99679fe7f8afc70254c5ff9f0d202028911ccad4
parentffcb031033a345dbf85cb2d3278a602b2a5334ca
vfio-pci: Fix remove path locking

Locking both the remove() and release() path results in a deadlock
that should have been obvious.  To fix this we can get and hold the
vfio_device reference as we evaluate whether to do a bus/slot reset.
This will automatically block any remove() calls, allowing us to
remove the explict lock.  Fixes 2d1110bd6146.

Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Cc: stable@vger.kernel.org [3.17]
drivers/vfio/pci/vfio_pci.c