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: 7f92891778 ("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>
This commit is contained in:
Greg Kurz 2019-04-19 17:37:17 +02:00 committed by Alex Williamson
parent 41be3e2618
commit 2c85f2bd51

View File

@ -472,6 +472,8 @@ int vfio_pci_ibm_npu2_init(struct vfio_pci_device *vdev)
return 0;
free_exit:
if (data->base)
memunmap(data->base);
kfree(data);
return ret;