[PATCH v1 11/12] iommufd: Introduce iommufd_object_alloc_ucmd helper

Jason Gunthorpe jgg at nvidia.com
Fri Jun 13 06:58:17 PDT 2025


On Mon, Jun 09, 2025 at 10:13:34AM -0700, Nicolin Chen wrote:

> +#define iommufd_object_alloc_ucmd(ucmd, ptr, type) \
> +	__iommufd_object_alloc_ucmd(ucmd, ptr, type, obj)

Lets add a comment here and on the normal iommufd_object_alloc
explaining that this function automatically calls finalize and abort,
the non ucmd version requires the caller to do so.

> +struct iommufd_object *_iommufd_object_alloc_ucmd(struct iommufd_ucmd *ucmd,
> +						  size_t size,
> +						  enum iommufd_object_type type)
> +{
> +	struct iommufd_object *new_obj;
> +
> +	if (ucmd->new_obj)

WARN_ON? Something is coded wrong if we hit this right?

Jason



More information about the linux-arm-kernel mailing list