Re: [PATCH v3 3/5] iommu/amd: Split probe error paths to preserve IRQ remapping
From: Jason Gunthorpe
Date: Mon Aug 24 2026 - 14:13:53 EST
> [ ... 15 lines skipped ... ]
> @@ -2540,8 +2540,7 @@ static struct iommu_device *amd_iommu_probe_device(struct device *dev)
> ret = PTR_ERR(dev_data);
> dev_err(dev, "Failed to initialize - trying to proceed anyway\n");
> iommu_dev = ERR_PTR(ret);
I would drop this line and fix the return to have the ERR_PTR
> +err_deinit:
> + iommu_disable_device(iommu, dev);
> out_err:
> return iommu_dev;
Otherwise this landmine is going to hurt someday since there is only
one flow that would have an err ptr in iommu_dev.
--
Jason