linux-stable/drivers/iommu
Xiongfeng Wang 2a8f7b9068 iommu/vt-d: Fix PCI device refcount leak in dmar_dev_scope_init()
[ Upstream commit 4bedbbd782 ]

for_each_pci_dev() is implemented by pci_get_device(). The comment of
pci_get_device() says that it will increase the reference count for the
returned pci_dev and also decrease the reference count for the input
pci_dev @from if it is not NULL.

If we break for_each_pci_dev() loop with pdev not NULL, we need to call
pci_dev_put() to decrease the reference count. Add the missing
pci_dev_put() for the error path to avoid reference count leak.

Fixes: 2e45528930 ("iommu/vt-d: Unify the way to process DMAR device scope array")
Signed-off-by: Xiongfeng Wang <wangxiongfeng2@huawei.com>
Link: https://lore.kernel.org/r/20221121113649.190393-3-wangxiongfeng2@huawei.com
Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-12-08 11:30:21 +01:00
..
amd iommu: Fix false ownership failure on AMD systems with PASID activated 2022-09-11 08:30:41 +02:00
arm iommu/arm-smmu-v3: Make default domain type of HiSilicon PTT device to identity 2022-10-21 12:39:22 +02:00
intel iommu/vt-d: Fix PCI device refcount leak in dmar_dev_scope_init() 2022-12-08 11:30:21 +01:00
apple-dart.c
dma-iommu.c Revert "iommu/dma: Add config for PCI SAC address trick" 2022-08-06 13:24:56 -07:00
exynos-iommu.c
fsl_pamu.c
fsl_pamu.h
fsl_pamu_domain.c
fsl_pamu_domain.h
hyperv-iommu.c
io-pgfault.c
io-pgtable-arm-v7s.c
io-pgtable-arm.c
io-pgtable-arm.h
io-pgtable.c
ioasid.c
iommu-debugfs.c
iommu-sva-lib.c
iommu-sva-lib.h
iommu-sysfs.c
iommu-traces.c
iommu.c iommu: Fix false ownership failure on AMD systems with PASID activated 2022-09-11 08:30:41 +02:00
iova.c dma-mapping updates 2022-08-06 10:56:45 -07:00
ipmmu-vmsa.c
irq_remapping.c
irq_remapping.h
Kconfig Revert "iommu/dma: Add config for PCI SAC address trick" 2022-08-06 13:24:56 -07:00
Makefile
msm_iommu.c
msm_iommu.h
msm_iommu_hw-8xxx.h
mtk_iommu.c
mtk_iommu_v1.c
of_iommu.c Revert "iommu/of: Delete usage of driver_deferred_probe_check_state()" 2022-08-23 13:14:02 +02:00
omap-iommu-debug.c iommu/omap: Fix buffer overflow in debugfs 2022-10-21 12:38:59 +02:00
omap-iommu.c
omap-iommu.h
omap-iopgtable.h
rockchip-iommu.c
s390-iommu.c
sprd-iommu.c
sun50i-iommu.c
tegra-gart.c
tegra-smmu.c
virtio-iommu.c iommu/virtio: Fix interaction with VFIO 2022-09-07 15:44:58 +02:00