Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 129d6aba authored by Joerg Roedel's avatar Joerg Roedel Committed by Ingo Molnar
Browse files

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: default avatarJoerg Roedel <joerg.roedel@amd.com>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent 8a456695
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -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;