'vfio_group_get_from_dev()' seems to return only NULL on error, not an
error pointer.
Fixes: 2169037dc322 ("vfio iommu: Added pin and unpin callback functions to vfio_iommu_driver_ops")
Fixes: c086de818dd8 ("vfio iommu: Add blocking notifier to notify DMA_UNMAP")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
return -E2BIG;
group = vfio_group_get_from_dev(dev);
- if (IS_ERR(group))
- return PTR_ERR(group);
+ if (!group)
+ return -ENODEV;
ret = vfio_group_add_container_user(group);
if (ret)
return -E2BIG;
group = vfio_group_get_from_dev(dev);
- if (IS_ERR(group))
- return PTR_ERR(group);
+ if (!group)
+ return -ENODEV;
ret = vfio_group_add_container_user(group);
if (ret)
return -EINVAL;
group = vfio_group_get_from_dev(dev);
- if (IS_ERR(group))
- return PTR_ERR(group);
+ if (!group)
+ return -ENODEV;
ret = vfio_group_add_container_user(group);
if (ret)
return -EINVAL;
group = vfio_group_get_from_dev(dev);
- if (IS_ERR(group))
- return PTR_ERR(group);
+ if (!group)
+ return -ENODEV;
ret = vfio_group_add_container_user(group);
if (ret)