diff options
author | Kaige Li <likaige@loongson.cn> | 2020-08-11 04:59:57 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-10-29 11:07:14 +0300 |
commit | 94ae143ca57be1174bbd256a74bb2a1142f5d260 (patch) | |
tree | 18d44195ef34f994e63c109ace4072f97d576305 /drivers/ntb | |
parent | 477dfe7d985a2c21e3e55c5bf5989a629f296ae1 (diff) | |
download | linux-94ae143ca57be1174bbd256a74bb2a1142f5d260.tar.xz |
NTB: hw: amd: fix an issue about leak system resources
[ Upstream commit 44a0a3c17919db1498cebb02ecf3cf4abc1ade7b ]
The related system resources were not released when pci_set_dma_mask(),
pci_set_consistent_dma_mask(), or pci_iomap() return error in the
amd_ntb_init_pci() function. Add pci_release_regions() to fix it.
Fixes: a1b3695820aa ("NTB: Add support for AMD PCI-Express Non-Transparent Bridge")
Signed-off-by: Kaige Li <likaige@loongson.cn>
Signed-off-by: Jon Mason <jdmason@kudzu.us>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/ntb')
-rw-r--r-- | drivers/ntb/hw/amd/ntb_hw_amd.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/ntb/hw/amd/ntb_hw_amd.c b/drivers/ntb/hw/amd/ntb_hw_amd.c index f0788aae05c9..72a7981ef73f 100644 --- a/drivers/ntb/hw/amd/ntb_hw_amd.c +++ b/drivers/ntb/hw/amd/ntb_hw_amd.c @@ -1032,6 +1032,7 @@ static int amd_ntb_init_pci(struct amd_ntb_dev *ndev, err_dma_mask: pci_clear_master(pdev); + pci_release_regions(pdev); err_pci_regions: pci_disable_device(pdev); err_pci_enable: |