diff options
author | Alexey Kardashevskiy <aik@ozlabs.ru> | 2019-12-23 12:09:27 +1100 |
---|---|---|
committer | Alex Williamson <alex.williamson@redhat.com> | 2020-01-06 10:01:05 -0700 |
commit | 338b4e10f939a71194d8ecef7ece205a942cec05 (patch) | |
tree | ce0b588173984a2285d663c4f61c91ba085b103e /drivers/gpio/gpio-lpc18xx.c | |
parent | c79f46a282390e0f5b306007bf7b11a46d529538 (diff) | |
download | linux-338b4e10f939a71194d8ecef7ece205a942cec05.tar.bz2 |
vfio/spapr/nvlink2: Skip unpinning pages on error exit
The nvlink2 subdriver for IBM Witherspoon machines preregisters
GPU memory in the IOMMI API so KVM TCE code can map this memory
for DMA as well. This is done by mm_iommu_newdev() called from
vfio_pci_nvgpu_regops::mmap.
In an unlikely event of failure the data->mem remains NULL and
since mm_iommu_put() (which unregisters the region and unpins memory
if that was regular memory) does not expect mem=NULL, it should not be
called.
This adds a check to only call mm_iommu_put() for a valid data->mem.
Fixes: 7f92891778df ("vfio_pci: Add NVIDIA GV100GL [Tesla V100 SXM2] subdriver")
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Diffstat (limited to 'drivers/gpio/gpio-lpc18xx.c')
0 files changed, 0 insertions, 0 deletions