mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-28 22:54:05 +08:00
vfio: fix a missed vfio group put in vfio_pin_pages
When error occurs, need to put vfio group after a successful get.
Fixes: 95fc87b441
("vfio: Selective dirty page tracking if IOMMU backed device pins pages")
Signed-off-by: Yan Zhao <yan.y.zhao@intel.com>
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
This commit is contained in:
parent
7ef32e5236
commit
28b1302440
@ -1949,8 +1949,10 @@ int vfio_pin_pages(struct device *dev, unsigned long *user_pfn, int npage,
|
||||
if (!group)
|
||||
return -ENODEV;
|
||||
|
||||
if (group->dev_counter > 1)
|
||||
return -EINVAL;
|
||||
if (group->dev_counter > 1) {
|
||||
ret = -EINVAL;
|
||||
goto err_pin_pages;
|
||||
}
|
||||
|
||||
ret = vfio_group_add_container_user(group);
|
||||
if (ret)
|
||||
|
Loading…
Reference in New Issue
Block a user