diff options
| author | Joerg Roedel <joerg.roedel@amd.com> | 2008-08-14 13:55:18 -0400 |
|---|---|---|
| committer | Ingo Molnar <mingo@elte.hu> | 2008-08-15 07:56:56 -0400 |
| commit | 129d6aba444d1e99d4cbfb9866a4652912426b65 (patch) | |
| tree | 3c2c6dee01907dd7203dac640e4c34a66c321224 | |
| parent | 8a456695c5020d6317f9c7af190999e9414b0d3e (diff) | |
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.c | 6 |
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) | |||
| 972 | if (acpi_table_parse("IVRS", init_memory_definitions) != 0) | 972 | if (acpi_table_parse("IVRS", init_memory_definitions) != 0) |
| 973 | goto free; | 973 | goto free; |
| 974 | 974 | ||
| 975 | ret = amd_iommu_init_dma_ops(); | 975 | ret = sysdev_class_register(&amd_iommu_sysdev_class); |
| 976 | if (ret) | 976 | if (ret) |
| 977 | goto free; | 977 | goto free; |
| 978 | 978 | ||
| 979 | ret = sysdev_class_register(&amd_iommu_sysdev_class); | 979 | ret = sysdev_register(&device_amd_iommu); |
| 980 | if (ret) | 980 | if (ret) |
| 981 | goto free; | 981 | goto free; |
| 982 | 982 | ||
| 983 | ret = sysdev_register(&device_amd_iommu); | 983 | ret = amd_iommu_init_dma_ops(); |
| 984 | if (ret) | 984 | if (ret) |
| 985 | goto free; | 985 | goto free; |
| 986 | 986 | ||
