[PATCH 1/3] iommu/ipmmu-vmsa: Propagate errors from iommu_fwspec_add_ids()
From: Koichiro Den
Date: Wed Nov 04 2026 - 11:31:17 EST
iommu_fwspec_add_ids() can fail while extending the ID array. Ignoring
its return value lets IOMMU setup continue with missing micro-TLB IDs.
Propagate the error so of_iommu_configure() can discard the incomplete
fwspec.
Cc: stable@xxxxxxxxxxxxxxx
Fixes: 7b2d59611fef ("iommu/ipmmu-vmsa: Replace local utlb code with fwspec ids")
Signed-off-by: Koichiro Den <den@xxxxxxxxxxxxx>
---
drivers/iommu/ipmmu-vmsa.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/iommu/ipmmu-vmsa.c b/drivers/iommu/ipmmu-vmsa.c
index 9386b752dea2..99586c68ef35 100644
--- a/drivers/iommu/ipmmu-vmsa.c
+++ b/drivers/iommu/ipmmu-vmsa.c
@@ -778,10 +778,14 @@ static bool ipmmu_device_is_allowed(struct device *dev)
static int ipmmu_of_xlate(struct device *dev,
const struct of_phandle_args *spec)
{
+ int ret;
+
if (!ipmmu_device_is_allowed(dev))
return -ENODEV;
- iommu_fwspec_add_ids(dev, spec->args, 1);
+ ret = iommu_fwspec_add_ids(dev, spec->args, 1);
+ if (ret)
+ return ret;
/* Initialize once - xlate() will call multiple times */
if (to_ipmmu(dev))
--
2.54.0