vfio-pci/nvlink2: Fix potential VMA leak
authorGreg Kurz <groug@kaod.org>
Fri, 19 Apr 2019 15:37:17 +0000 (17:37 +0200)
committerAlex Williamson <alex.williamson@redhat.com>
Wed, 1 May 2019 19:31:41 +0000 (13:31 -0600)
commit2c85f2bd519457073444ec28bbb4743a4e4237a7
tree3e3255c98bdb2a58a48decdac270d3a708a6e228
parent41be3e2618174fdf3361e49e64f2bf530f40c6b0
vfio-pci/nvlink2: Fix potential VMA leak

If vfio_pci_register_dev_region() fails then we should rollback
previous changes, ie. unmap the ATSD registers.

Fixes: 7f92891778df ("vfio_pci: Add NVIDIA GV100GL [Tesla V100 SXM2] subdriver")
Signed-off-by: Greg Kurz <groug@kaod.org>
Reviewed-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
drivers/vfio/pci/vfio_pci_nvlink2.c