mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-02 23:27:06 +00:00
iommu/amd: Make iommu_disable safer
[ Upstream commit3ddbe913e5
] 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:2c0ae1720c
('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>
This commit is contained in:
parent
959c90f32b
commit
511d8decd1
1 changed files with 3 additions and 0 deletions
|
@ -422,6 +422,9 @@ static void iommu_enable(struct amd_iommu *iommu)
|
|||
|
||||
static void iommu_disable(struct amd_iommu *iommu)
|
||||
{
|
||||
if (!iommu->mmio_base)
|
||||
return;
|
||||
|
||||
/* Disable command buffer */
|
||||
iommu_feature_disable(iommu, CONTROL_CMDBUF_EN);
|
||||
|
||||
|
|
Loading…
Reference in a new issue