access->ictx should be NULL for internal. It should have been:struct iommufd_eventq {I was hoping we could null the ictx to signal internal? That didn't
struct iommufd_object obj;
struct iommufd_ctx *ictx;
diff --git a/drivers/iommu/iommufd/device.c b/drivers/iommu/iommufd/device.c
index 9293722b9cff..ad33f1e41a24 100644
--- a/drivers/iommu/iommufd/device.c
+++ b/drivers/iommu/iommufd/device.c
@@ -1084,7 +1084,39 @@ void iommufd_access_destroy_object(struct iommufd_object *obj)
if (access->ioas)
WARN_ON(iommufd_access_change_ioas(access, NULL));
mutex_unlock(&access->ioas_lock);
- iommufd_ctx_put(access->ictx);
+ if (access->ops)
+ iommufd_ctx_put(access->ictx);
work out?
+ if (access->ictx)
+ iommufd_ctx_put(access->ictx);