summaryrefslogtreecommitdiffstats
path: root/drivers/iommu
diff options
context:
space:
mode:
authorYang Yingliang <yangyingliang@huawei.com>2022-11-18 17:36:04 +0800
committerJoerg Roedel <jroedel@suse.de>2022-11-19 11:00:29 +0100
commit6cf0981c2233f97d56938d9d61845383d6eb227c (patch)
tree96efb3dd336803f13782da5888c3e52b289f929c /drivers/iommu
parent1198d2316dc4265a97d0e8445a22c7a6d17580a4 (diff)
downloadlinux-6cf0981c2233f97d56938d9d61845383d6eb227c.tar.gz
linux-6cf0981c2233f97d56938d9d61845383d6eb227c.tar.bz2
linux-6cf0981c2233f97d56938d9d61845383d6eb227c.zip
iommu/amd: Fix pci device refcount leak in ppr_notifier()
As comment of pci_get_domain_bus_and_slot() says, it returns a pci device with refcount increment, when finish using it, the caller must decrement the reference count by calling pci_dev_put(). So call it before returning from ppr_notifier() to avoid refcount leak. Fixes: daae2d25a477 ("iommu/amd: Don't copy GCR3 table root pointer") Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Link: https://lore.kernel.org/r/20221118093604.216371-1-yangyingliang@huawei.com Signed-off-by: Joerg Roedel <jroedel@suse.de>
Diffstat (limited to 'drivers/iommu')
-rw-r--r--drivers/iommu/amd/iommu_v2.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/iommu/amd/iommu_v2.c b/drivers/iommu/amd/iommu_v2.c
index 6a1f02c62dff..9f7fab49a5a9 100644
--- a/drivers/iommu/amd/iommu_v2.c
+++ b/drivers/iommu/amd/iommu_v2.c
@@ -587,6 +587,7 @@ out_drop_state:
put_device_state(dev_state);
out:
+ pci_dev_put(pdev);
return ret;
}