[PATCH] iommu/mediatek: Fix NULL pointer deference in mtk_iommu_device_group

Chen-Yu Tsai wenst at chromium.org
Fri Mar 28 03:04:09 PDT 2025


On Thu, Mar 27, 2025 at 6:48 PM Louis-Alexis Eyraud
<louisalexis.eyraud at collabora.com> wrote:
>
> 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: 9e3a2a643653 ("iommu/mediatek: Adapt sharing and non-sharing pgtable case")
> Fixes: bcb81ac6ae3c ("iommu: Get DT/ACPI parsing into the proper probe path")
> Signed-off-by: Louis-Alexis Eyraud <louisalexis.eyraud at collabora.com>

Tested-by: Chen-Yu Tsai <wenst at chromium.org> # MT8183 Juniper, MT8186 Tentacruel



More information about the linux-arm-kernel mailing list