Skip to contentSkip to conversation

AMD IOMMU: initialize dma_ops after sysfs registration

PATCH New Joerg Roedel 1 participant 1 message Aug 4, 2008 x86

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 AMD IOMMU: initialize dma_ops after sysfs registration

This patch moves the initialization of the dma_ops interface for AMD IOMMU behind the sysfs registration. Without this and if sysfs registration fails the AMD IOMMU driver is still in place and operates on already freed data.

---
 arch/x86/kernel/amd_iommu_init.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
arch/x86/kernel/amd_iommu_init.c +3 -3
index d9a9da5..880249d 100644
@@ -954,15 +954,15 @@ int __init amd_iommu_init(void)
 	if (acpi_table_parse("IVRS", init_memory_definitions) != 0)
 		goto free;
 
-	ret = amd_iommu_init_dma_ops();
+	ret = sysdev_class_register(&amd_iommu_sysdev_class);
 	if (ret)
 		goto free;
 
-	ret = sysdev_class_register(&amd_iommu_sysdev_class);
+	ret = sysdev_register(&device_amd_iommu);
 	if (ret)
 		goto free;
 
-	ret = sysdev_register(&device_amd_iommu);
+	ret = amd_iommu_init_dma_ops();
 	if (ret)
 		goto free;
 
Signature · 1 line
1.5.3.7