On Tue, Jul 25, 2023 at 04:05:48PM -0300, Jason Gunthorpe wrote: > The access must be detached first. > > To make the cleanup simpler copy the fdno to userspace before creating the > access in the first place. Then there is no need to unwind after > iommufd_access_attach. > > Fixes: 54b47585db66 ("iommufd: Create access in vfio_iommufd_emulated_bind()") > Signed-off-by: Jason Gunthorpe <jgg@xxxxxxxxxx> > --- > drivers/iommu/iommufd/selftest.c | 9 +++++---- > 1 file changed, 5 insertions(+), 4 deletions(-) <formletter> This is not the correct way to submit patches for inclusion in the stable kernel tree. Please read: https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html for how to do this properly. </formletter>