diff --git a/drivers/vfio/vfio.c b/drivers/vfio/vfio.c index 580099afeaffa..2a70e25cfe954 100644 --- a/drivers/vfio/vfio.c +++ b/drivers/vfio/vfio.c @@ -2050,6 +2050,9 @@ int vfio_group_pin_pages(struct vfio_group *group, if (!group || !user_iova_pfn || !phys_pfn || !npage) return -EINVAL; + if (group->dev_counter > 1) + return -EINVAL; + if (npage > VFIO_PIN_PAGES_MAX_ENTRIES) return -E2BIG;