Re: [PATCH v3] iommu/msm: Fix dangling list entry on probe failure
From: Konrad Dybcio
Date: Thu Jul 16 2026 - 05:46:04 EST
On 7/16/26 10:53 AM, Weimin Xiong wrote:
> Move the list_add() call to the end of msm_iommu_probe() instead of
> adding cleanup paths, which avoids the dangling list entry problem
> entirely (suggested by Mukesh Ojha).
>
> This approach simplifies the code by ensuring the iommu device is
> never added to the global list until after all potential failure
> points have passed.
>
> Changes in v3:
> - Move list_add() to the end instead of adding cleanup labels
> (suggested by Mukesh Ojha)
I think this approach introduces a race condition, because e.g.
iommu_ops->of_xlate() depends on the item being present in this list
Konrad