vfio/pci: Clear error and request eventfd ctx after releasing
authorAlex Williamson <alex.williamson@redhat.com>
Tue, 16 Jun 2020 21:26:36 +0000 (15:26 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 1 Oct 2020 11:12:47 +0000 (13:12 +0200)
commitc415d51721e4f5fd460e39d625af833ef55f82d1
treed955ec9744b3dffe7c101b405aa2cbd71a47c542
parent52f7d8a4b5291d830dc22f680f072246342659f7
vfio/pci: Clear error and request eventfd ctx after releasing

[ Upstream commit 5c5866c593bbd444d0339ede6a8fb5f14ff66d72 ]

The next use of the device will generate an underflow from the
stale reference.

Cc: Qian Cai <cai@lca.pw>
Fixes: 1518ac272e78 ("vfio/pci: fix memory leaks of eventfd ctx")
Reported-by: Daniel Wagner <dwagner@suse.de>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Tested-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/vfio/pci/vfio_pci.c