mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-07 03:18:31 +00:00
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>
This commit is contained in:
parent
8a456695c5
commit
129d6aba44
1 changed files with 4 additions and 4 deletions
|
@ -972,10 +972,6 @@ int __init amd_iommu_init(void)
|
||||||
if (acpi_table_parse("IVRS", init_memory_definitions) != 0)
|
if (acpi_table_parse("IVRS", init_memory_definitions) != 0)
|
||||||
goto free;
|
goto free;
|
||||||
|
|
||||||
ret = amd_iommu_init_dma_ops();
|
|
||||||
if (ret)
|
|
||||||
goto free;
|
|
||||||
|
|
||||||
ret = sysdev_class_register(&amd_iommu_sysdev_class);
|
ret = sysdev_class_register(&amd_iommu_sysdev_class);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto free;
|
goto free;
|
||||||
|
@ -984,6 +980,10 @@ int __init amd_iommu_init(void)
|
||||||
if (ret)
|
if (ret)
|
||||||
goto free;
|
goto free;
|
||||||
|
|
||||||
|
ret = amd_iommu_init_dma_ops();
|
||||||
|
if (ret)
|
||||||
|
goto free;
|
||||||
|
|
||||||
enable_iommus();
|
enable_iommus();
|
||||||
|
|
||||||
printk(KERN_INFO "AMD IOMMU: aperture size is %d MB\n",
|
printk(KERN_INFO "AMD IOMMU: aperture size is %d MB\n",
|
||||||
|
|
Loading…
Reference in a new issue