Skip to content
Commit 38e88440 authored by Louis-Alexis Eyraud's avatar Louis-Alexis Eyraud Committed by Joerg Roedel
Browse files

iommu/mediatek: Fix NULL pointer deference in mtk_iommu_device_group



Currently, mtk_iommu calls during probe iommu_device_register before
the hw_list from driver data is initialized. Since iommu probing issue
fix, it leads to NULL pointer dereference in mtk_iommu_device_group when
hw_list is accessed with list_first_entry (not null safe).

So, change the call order to ensure iommu_device_register is called
after the driver data are initialized.

Fixes: 9e3a2a64 ("iommu/mediatek: Adapt sharing and non-sharing pgtable case")
Fixes: bcb81ac6 ("iommu: Get DT/ACPI parsing into the proper probe path")
Reviewed-by: default avatarYong Wu <yong.wu@mediatek.com>
Tested-by: Chen-Yu Tsai <wenst@chromium.org> # MT8183 Juniper, MT8186 Tentacruel
Reviewed-by: default avatarAngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Tested-by: default avatarAngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: default avatarLouis-Alexis Eyraud <louisalexis.eyraud@collabora.com>
Link: https://lore.kernel.org/r/20250403-fix-mtk-iommu-error-v2-1-fe8b18f8b0a8@collabora.com


Signed-off-by: default avatarJoerg Roedel <jroedel@suse.de>
parent 99deffc4
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment