Re: [PATCH V2 03/11] iommufd: Allow binding to a noiommu device

Jason Gunthorpe
2026-03-23T13:20:22Z

On Sun, Mar 22, 2026 at 09:54:15AM +0000, Mostafa Saleh wrote:
> > +struct iommufd_device *iommufd_device_bind(struct iommufd_ctx *ictx,
> > + struct device *dev, u32 *id)
> > +{
> > + struct iommufd_device *idev;
> > + int rc;
> > +
> > idev = iommufd_object_alloc(ictx, idev, IOMMUFD_OBJ_DEVICE);
>
> The next code introduces new error cases, do that need to be cleaned in
> that case by calling iommufd_object_abort_and_destroy()?

It should probably use iommufd_object_alloc_ucmd() so the core code
manages the lifecycle?

Jason