summaryrefslogtreecommitdiffstats
path: root/drivers/ntb
diff options
context:
space:
mode:
authorKaige Li <likaige@loongson.cn>2020-08-11 09:59:57 +0800
committerJon Mason <jdmason@kudzu.us>2020-08-23 22:36:32 -0400
commit44a0a3c17919db1498cebb02ecf3cf4abc1ade7b (patch)
tree8fda78fe848c39e316b06b54899175fdb212e79e /drivers/ntb
parentd012a7190fc1fd72ed48911e77ca97ba4521bccd (diff)
downloadlinux-stable-44a0a3c17919db1498cebb02ecf3cf4abc1ade7b.tar.gz
linux-stable-44a0a3c17919db1498cebb02ecf3cf4abc1ade7b.tar.bz2
linux-stable-44a0a3c17919db1498cebb02ecf3cf4abc1ade7b.zip
NTB: hw: amd: fix an issue about leak system resources
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>
Diffstat (limited to 'drivers/ntb')
-rw-r--r--drivers/ntb/hw/amd/ntb_hw_amd.c1
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 88e1db65be02..71428d8cbcfc 100644
--- a/drivers/ntb/hw/amd/ntb_hw_amd.c
+++ b/drivers/ntb/hw/amd/ntb_hw_amd.c
@@ -1203,6 +1203,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: