Skip to content

Commit 1c61d51

Browse files
Liam Niawilliam
authored andcommitted
vfio: check iommu_group_set_name() return value
As iommu_group_set_name() can fail, we should check the return value. Signed-off-by: Liam Ni <[email protected]> Reviewed-by: Jason Gunthorpe <[email protected]> Reviewed-by: Kevin Tian <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alex Williamson <[email protected]>
1 parent d1877e6 commit 1c61d51

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/vfio/vfio.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,9 @@ static struct vfio_group *vfio_noiommu_group_alloc(struct device *dev,
504504
if (IS_ERR(iommu_group))
505505
return ERR_CAST(iommu_group);
506506

507-
iommu_group_set_name(iommu_group, "vfio-noiommu");
507+
ret = iommu_group_set_name(iommu_group, "vfio-noiommu");
508+
if (ret)
509+
goto out_put_group;
508510
ret = iommu_group_add_device(iommu_group, dev);
509511
if (ret)
510512
goto out_put_group;

0 commit comments

Comments
 (0)