]> 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)
commit7610d3ac58dd77f5867fe61a74e574c0f91bd9a8
tree99679fe7f8afc70254c5ff9f0d202028911ccad4
parentb0d24bcc7ca951c3fe90a25995146b234b84abf0
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 2ce488fe2b3a.

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