linux-stable/drivers/iommu
Xiongfeng Wang 4bedbbd782 iommu/vt-d: Fix PCI device refcount leak in dmar_dev_scope_init()
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>
2022-12-02 11:45:33 +01:00
..
amd iommu: Add gfp parameter to iommu_alloc_resv_region 2022-10-21 10:49:32 +02:00
arm iommu: Add gfp parameter to iommu_alloc_resv_region 2022-10-21 10:49:32 +02:00
intel iommu/vt-d: Fix PCI device refcount leak in dmar_dev_scope_init() 2022-12-02 11:45:33 +01:00
apple-dart.c iommu: Add gfp parameter to iommu_alloc_resv_region 2022-10-21 10:49:32 +02:00
dma-iommu.c iommu/dma: Make header private 2022-09-09 09:26:22 +02:00
dma-iommu.h iommu/dma: Make header private 2022-09-09 09:26:22 +02:00
exynos-iommu.c iommu/exynos: Clean up bus_set_iommu() 2022-09-07 14:26:14 +02:00
fsl_pamu.c iommu/fsl_pamu: Prepare cleanup of powerpc's asm/prom.h 2022-04-28 10:20:11 +02:00
fsl_pamu.h
fsl_pamu_domain.c iommu: Clean up bus_set_iommu() 2022-09-07 14:26:17 +02:00
fsl_pamu_domain.h
hyperv-iommu.c iommu/hyper-v: Use helper instead of directly accessing affinity 2022-08-04 10:02:09 +01:00
io-pgfault.c
io-pgtable-arm-v7s.c iommu/io-pgtable-arm-v7s: Add a quirk to allow pgtable PA up to 35bit 2022-07-07 09:42:59 +02:00
io-pgtable-arm.c Merge branches 'apple/dart', 'arm/mediatek', 'arm/omap', 'arm/smmu', 'virtio', 'x86/vt-d', 'x86/amd' and 'core' into next 2022-09-26 15:52:31 +02:00
io-pgtable-arm.h
io-pgtable-dart.c iommu/io-pgtable-dart: Add DART PTE support for t6000 2022-09-26 13:49:40 +02:00
io-pgtable.c Merge branches 'apple/dart', 'arm/mediatek', 'arm/omap', 'arm/smmu', 'virtio', 'x86/vt-d', 'x86/amd' and 'core' into next 2022-09-26 15:52:31 +02:00
ioasid.c iommu/sva: Assign a PASID to mm on PASID allocation and free it on mm exit 2022-02-15 11:31:35 +01:00
iommu-debugfs.c
iommu-sva-lib.c iommu/sva: Assign a PASID to mm on PASID allocation and free it on mm exit 2022-02-15 11:31:35 +01:00
iommu-sva-lib.h iommu/sva: Assign a PASID to mm on PASID allocation and free it on mm exit 2022-02-15 11:31:35 +01:00
iommu-sysfs.c
iommu-traces.c
iommu.c iommu: Add gfp parameter to iommu_alloc_resv_region 2022-10-21 10:49:32 +02:00
iova.c iova: Remove iovad->rcaches check in iova_rcache_get() 2022-09-09 09:27:03 +02:00
ipmmu-vmsa.c iommu/ipmmu-vmsa: Clean up bus_set_iommu() 2022-09-07 14:26:14 +02:00
irq_remapping.c
irq_remapping.h
Kconfig Merge branches 'apple/dart', 'arm/mediatek', 'arm/omap', 'arm/smmu', 'virtio', 'x86/vt-d', 'x86/amd' and 'core' into next 2022-09-26 15:52:31 +02:00
Makefile iommu/io-pgtable: Move Apple DART support to its own file 2022-09-26 13:48:40 +02:00
msm_iommu.c iommu: Clean up bus_set_iommu() 2022-09-07 14:26:17 +02:00
msm_iommu.h
msm_iommu_hw-8xxx.h
mtk_iommu.c iommu: Add gfp parameter to iommu_alloc_resv_region 2022-10-21 10:49:32 +02:00
mtk_iommu_v1.c iommu/mtk: Clean up bus_set_iommu() 2022-09-07 14:26:15 +02:00
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-09-07 10:42:28 +02:00
omap-iommu.c iommu/omap: Clean up bus_set_iommu() 2022-09-07 14:26:15 +02:00
omap-iommu.h
omap-iopgtable.h
rockchip-iommu.c iommu: Clean up bus_set_iommu() 2022-09-07 14:26:17 +02:00
s390-iommu.c iommu: Clean up bus_set_iommu() 2022-09-07 14:26:17 +02:00
sprd-iommu.c iommu: Clean up bus_set_iommu() 2022-09-07 14:26:17 +02:00
sun50i-iommu.c iommu: Clean up bus_set_iommu() 2022-09-07 14:26:17 +02:00
tegra-gart.c iommu: Make .release_device optional 2022-07-06 12:55:53 +02:00
tegra-smmu.c iommu/tegra-smmu: Clean up bus_set_iommu() 2022-09-07 14:26:16 +02:00
virtio-iommu.c iommu: Add gfp parameter to iommu_alloc_resv_region 2022-10-21 10:49:32 +02:00