Commit 1c61d51e authored by Liam Ni's avatar Liam Ni Committed by Alex Williamson
Browse files

vfio: check iommu_group_set_name() return value



As iommu_group_set_name() can fail, we should check the return value.

Signed-off-by: default avatarLiam Ni <zhiguangni01@gmail.com>
Reviewed-by: default avatarJason Gunthorpe <jgg@nvidia.com>
Reviewed-by: default avatarKevin Tian <kevin.tian@intel.com>
Link: https://lore.kernel.org/r/20220625114239.9301-1-zhiguangni01@gmail.com


Signed-off-by: default avatarAlex Williamson <alex.williamson@redhat.com>
parent d1877e63
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -504,7 +504,9 @@ static struct vfio_group *vfio_noiommu_group_alloc(struct device *dev,
	if (IS_ERR(iommu_group))
		return ERR_CAST(iommu_group);

	iommu_group_set_name(iommu_group, "vfio-noiommu");
	ret = iommu_group_set_name(iommu_group, "vfio-noiommu");
	if (ret)
		goto out_put_group;
	ret = iommu_group_add_device(iommu_group, dev);
	if (ret)
		goto out_put_group;