]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
iommu/amd: Make iommu_disable safer
authorKevin Mitchell <kevmitch@arista.com>
Wed, 12 Jun 2019 21:52:03 +0000 (14:52 -0700)
committerKhalid Elmously <khalid.elmously@canonical.com>
Fri, 14 Feb 2020 05:29:37 +0000 (00:29 -0500)
commit71286830a53004e430294f870be87199c7276665
tree9eb8576a0f11d0da2b8551e334247331b8179842
parentce2c15a387ef379f2e027da13cac266911a0a07a
iommu/amd: Make iommu_disable safer

BugLink: https://bugs.launchpad.net/bugs/1863019
[ Upstream commit 3ddbe913e55516d3e2165d43d4d5570761769878 ]

Make it safe to call iommu_disable during early init error conditions
before mmio_base is set, but after the struct amd_iommu has been added
to the amd_iommu_list. For example, this happens if firmware fails to
fill in mmio_phys in the ACPI table leading to a NULL pointer
dereference in iommu_feature_disable.

Fixes: 2c0ae1720c09c ('iommu/amd: Convert iommu initialization to state machine')
Signed-off-by: Kevin Mitchell <kevmitch@arista.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/iommu/amd_iommu_init.c