diff options
author | Kaige Li <likaige@loongson.cn> | 2020-08-11 09:59:57 +0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-10-30 10:38:25 +0100 |
commit | 2d1fba2112ddb3fb8c906388167eb9b17fa0381c (patch) | |
tree | 9a3c7db4c240a62b9fd50536578f18a32cb96a8f | |
parent | b6addb4a03beff0d74c66bb3c20cd9836a73c4db (diff) | |
download | linux-stable-2d1fba2112ddb3fb8c906388167eb9b17fa0381c.tar.gz linux-stable-2d1fba2112ddb3fb8c906388167eb9b17fa0381c.tar.bz2 linux-stable-2d1fba2112ddb3fb8c906388167eb9b17fa0381c.zip |
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>
-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 efb214fc545a..0b1fbb5dba9b 100644 --- a/drivers/ntb/hw/amd/ntb_hw_amd.c +++ b/drivers/ntb/hw/amd/ntb_hw_amd.c @@ -1036,6 +1036,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: |