mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2025-04-14 11:27:32 +07:00
xen-gntdev: unlock on error path in gntdev_mmap()
We should unlock here and also decrement the number of &map->users. Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
This commit is contained in:
parent
12f0258d5b
commit
a93e20a830
@ -662,7 +662,7 @@ static int gntdev_mmap(struct file *flip, struct vm_area_struct *vma)
|
|||||||
if (map->flags) {
|
if (map->flags) {
|
||||||
if ((vma->vm_flags & VM_WRITE) &&
|
if ((vma->vm_flags & VM_WRITE) &&
|
||||||
(map->flags & GNTMAP_readonly))
|
(map->flags & GNTMAP_readonly))
|
||||||
return -EINVAL;
|
goto out_unlock_put;
|
||||||
} else {
|
} else {
|
||||||
map->flags = GNTMAP_host_map;
|
map->flags = GNTMAP_host_map;
|
||||||
if (!(vma->vm_flags & VM_WRITE))
|
if (!(vma->vm_flags & VM_WRITE))
|
||||||
@ -700,6 +700,8 @@ static int gntdev_mmap(struct file *flip, struct vm_area_struct *vma)
|
|||||||
spin_unlock(&priv->lock);
|
spin_unlock(&priv->lock);
|
||||||
return err;
|
return err;
|
||||||
|
|
||||||
|
out_unlock_put:
|
||||||
|
spin_unlock(&priv->lock);
|
||||||
out_put_map:
|
out_put_map:
|
||||||
if (use_ptemod)
|
if (use_ptemod)
|
||||||
map->vma = NULL;
|
map->vma = NULL;
|
||||||
|
Loading…
Reference in New Issue
Block a user