]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
PCI: Release IVRS table in AMD ACS quirk
authorHanjun Guo <guohanjun@huawei.com>
Wed, 22 Jul 2020 09:44:28 +0000 (17:44 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 Aug 2020 06:16:17 +0000 (08:16 +0200)
[ Upstream commit 090688fa4e448284aaa16136372397d7d10814db ]

The acpi_get_table() should be coupled with acpi_put_table() if the mapped
table is not used at runtime to release the table mapping.

In pci_quirk_amd_sb_acs(), IVRS table is just used for checking AMD IOMMU
is supported, not used at runtime, so put the table after using it.

Fixes: 15b100dfd1c9 ("PCI: Claim ACS support for AMD southbridge devices")
Link: https://lore.kernel.org/r/1595411068-15440-1-git-send-email-guohanjun@huawei.com
Signed-off-by: Hanjun Guo <guohanjun@huawei.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/pci/quirks.c

index 4ac4b28e0ebbf27b73a6aa45e74c1c567854ba62..9bc0f321aaf0eca2f605edc7f8e9be62db7ec7c8 100644 (file)
@@ -4446,6 +4446,8 @@ static int pci_quirk_amd_sb_acs(struct pci_dev *dev, u16 acs_flags)
        if (ACPI_FAILURE(status))
                return -ENODEV;
 
+       acpi_put_table(header);
+
        /* Filter out flags not applicable to multifunction */
        acs_flags &= (PCI_ACS_RR | PCI_ACS_CR | PCI_ACS_EC | PCI_ACS_DT);