Re: [PATCH v3 3/5] iommu/amd: Split probe error paths to preserve IRQ remapping
From: Pranjal Shrivastava
Date: Tue Aug 25 2026 - 06:34:51 EST
On Mon, Aug 24, 2026 at 03:13:21PM -0300, Jason Gunthorpe wrote:
> > [ ... 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.
>
Ack. I'd refactor this.
Thanks,
Praan