Skip to content
Commit 6927d352 authored by Yang Yingliang's avatar Yang Yingliang Committed by Joerg Roedel
Browse files

iommu/vt-d: Fix PCI device refcount leak in prq_event_thread()

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 decrease
the reference count by calling pci_dev_put(). So call pci_dev_put() after
using the 'pdev' to avoid refcount leak.

Besides, if the 'pdev' is null or intel_svm_prq_report() returns error,
there is no need to trace this fault.

Fixes: 06f4b8d0

 ("iommu/vt-d: Remove unnecessary SVA data accesses in page fault path")
Suggested-by: default avatarLu Baolu <baolu.lu@linux.intel.com>
Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20221119144028.2452731-1-yangyingliang@huawei.com
Signed-off-by: default avatarLu Baolu <baolu.lu@linux.intel.com>
Signed-off-by: default avatarJoerg Roedel <jroedel@suse.de>
parent e65a6897
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment