RE: [PATCH v7 1/6] iommufd: Support a HWPT without an iommu driver for noiommu
From: Tian, Kevin
Date: Wed Jun 03 2026 - 02:32:42 EST
> From: Jacob Pan <jacob.pan@xxxxxxxxxxxxxxxxxxx>
> Sent: Wednesday, June 3, 2026 1:45 PM
>
> +static const struct iommu_ops *get_iommu_ops(struct iommufd_device
> *idev)
> +{
> + if (IS_ENABLED(CONFIG_IOMMUFD_NOIOMMU) && !idev->igroup-
> >group)
> + return &iommufd_noiommu_ops;
> + if (WARN_ON_ONCE(!idev->dev->iommu))
> + return NULL;
> + return dev_iommu_ops(idev->dev);
> +}
Sashiko gave a valid comment:
"
While get_iommu_ops() correctly handles NO-IOMMU devices for hw_pagetable
allocations, do the vIOMMU and vDevice allocation paths also need similar
protection against NULL pointer dereferences?
"
with that fixed:
Reviewed-by: Kevin Tian <kevin.tian@xxxxxxxxx>