aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoerg Roedel <joerg.roedel@amd.com>2008-08-14 19:55:18 +0200
committerIngo Molnar <mingo@elte.hu>2008-08-15 13:56:56 +0200
commit129d6aba444d1e99d4cbfb9866a4652912426b65 (patch)
tree3c2c6dee01907dd7203dac640e4c34a66c321224
parentx86m AMD IOMMU: cleanup: replace LOW_U32 macro with generic lower_32_bits (diff)
downloadlinux-dev-129d6aba444d1e99d4cbfb9866a4652912426b65.tar.xz
linux-dev-129d6aba444d1e99d4cbfb9866a4652912426b65.zip
x86, AMD IOMMU: initialize dma_ops after sysfs registration
If sysfs registration fails all memory used by IOMMU is freed. This happens after dma_ops initialization and the functions will access the freed memory then. Fix this by initializing dma_ops after the sysfs registration. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r--arch/x86/kernel/amd_iommu_init.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/x86/kernel/amd_iommu_init.c b/arch/x86/kernel/amd_iommu_init.c
index ceba33811537..a69cc0f52042 100644
--- a/arch/x86/kernel/amd_iommu_init.c
+++ b/arch/x86/kernel/amd_iommu_init.c
@@ -972,15 +972,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;