WSL2-Linux-Kernel/drivers/iommu
Xiongfeng Wang bdb613ef17 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:28:44 +01:00
..
amd iommu/amd: use full 64-bit value in build_completion_wait() 2022-09-15 11:30:07 +02:00
arm iommu/arm-smmu-v3: Make default domain type of HiSilicon PTT device to identity 2022-10-26 12:35:47 +02:00
intel iommu/vt-d: Fix PCI device refcount leak in dmar_dev_scope_init() 2022-12-08 11:28:44 +01:00
Kconfig iommu/arm: fix ARM_SMMU_QCOM compilation 2021-10-13 21:28:44 +02:00
Makefile iommu/dart: Add DART iommu driver 2021-08-12 13:15:02 +02:00
apple-dart.c iommu/dart: Add missing module owner to ops structure 2022-05-12 12:30:23 +02:00
dma-iommu.c iommu/dma: Fix iova map result check bug 2022-06-09 10:23:27 +02:00
exynos-iommu.c iommu/exynos: Handle failed IOMMU device registration properly 2022-08-17 14:24:07 +02:00
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 iommu/io-pgtable-arm-v7s: Add a quirk to allow pgtable PA up to 35bit 2022-08-25 11:40:41 +02:00
io-pgtable-arm.c iommu/io-pgtable-arm: Fix table descriptor paddr formatting 2022-01-27 11:04:10 +01:00
io-pgtable-arm.h
io-pgtable.c iommu/io-pgtable: Add DART pagetable format 2021-08-12 13:15:02 +02:00
ioasid.c
iommu-debugfs.c
iommu-sva-lib.c
iommu-sva-lib.h
iommu-sysfs.c
iommu-traces.c
iommu.c iommu: Fix potential use-after-free during probe 2022-02-16 12:56:41 +01:00
iova.c iommu/iova: Improve 32-bit free space estimate 2022-04-08 14:22:48 +02:00
ipmmu-vmsa.c iommu/ipmmu-vmsa: Check for error num after setting mask 2022-04-08 14:23:31 +02:00
irq_remapping.c
irq_remapping.h
msm_iommu.c iommu/msm: Fix an incorrect NULL check on list iterator 2022-06-09 10:23:27 +02:00
msm_iommu.h
msm_iommu_hw-8xxx.h
mtk_iommu.c iommu/mediatek: Fix NULL pointer dereference when printing dev_name 2022-06-09 10:23:14 +02:00
mtk_iommu.h iommu/mediatek: Add mutex for m4u_group and m4u_dom in data 2022-06-09 10:23:14 +02:00
mtk_iommu_v1.c iommu/mediatek: Fix NULL pointer dereference when printing dev_name 2022-06-09 10:23:14 +02:00
of_iommu.c
omap-iommu-debug.c iommu/omap: Fix buffer overflow in debugfs 2022-10-26 12:35:25 +02:00
omap-iommu.c iommu/omap: Fix regression in probe for NULL pointer dereference 2022-04-13 20:59:20 +02:00
omap-iommu.h
omap-iopgtable.h
rockchip-iommu.c iommu/rockchip: Fix PAGE_DESC_HI_MASKs for RK3568 2021-12-01 09:04:54 +01:00
s390-iommu.c s390/pci: improve DMA translation init and exit 2021-08-25 11:03:34 +02:00
sprd-iommu.c iommu/sprd: Drop IOVA cookie management 2021-08-18 13:25:32 +02:00
sun50i-iommu.c iommu/sun50i: Drop IOVA cookie management 2021-08-18 13:25:32 +02:00
tegra-gart.c
tegra-smmu.c iommu/tegra-smmu: Fix missing put_device() call in tegra_smmu_find 2022-03-08 19:12:47 +01:00
virtio-iommu.c iommu/virtio: Drop IOVA cookie management 2021-08-18 13:25:32 +02:00