aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/xen
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/xen')
-rw-r--r--drivers/xen/gntdev.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/xen/gntdev.c b/drivers/xen/gntdev.c
index 9694a1a8b2e2..2aa83166da32 100644
--- a/drivers/xen/gntdev.c
+++ b/drivers/xen/gntdev.c
@@ -650,15 +650,13 @@ static int gntdev_mmap(struct file *flip, struct vm_area_struct *vma)
650 find_grant_ptes, map); 650 find_grant_ptes, map);
651 if (err) { 651 if (err) {
652 printk(KERN_WARNING "find_grant_ptes() failure.\n"); 652 printk(KERN_WARNING "find_grant_ptes() failure.\n");
653 return err; 653 goto out_put_map;
654 } 654 }
655 } 655 }
656 656
657 err = map_grant_pages(map); 657 err = map_grant_pages(map);
658 if (err) { 658 if (err)
659 printk(KERN_WARNING "map_grant_pages() failure.\n"); 659 goto out_put_map;
660 return err;
661 }
662 660
663 map->is_mapped = 1; 661 map->is_mapped = 1;
664 662
@@ -667,7 +665,7 @@ static int gntdev_mmap(struct file *flip, struct vm_area_struct *vma)
667 err = vm_insert_page(vma, vma->vm_start + i*PAGE_SIZE, 665 err = vm_insert_page(vma, vma->vm_start + i*PAGE_SIZE,
668 map->pages[i]); 666 map->pages[i]);
669 if (err) 667 if (err)
670 return err; 668 goto out_put_map;
671 } 669 }
672 } 670 }
673 671
@@ -676,6 +674,10 @@ static int gntdev_mmap(struct file *flip, struct vm_area_struct *vma)
676unlock_out: 674unlock_out:
677 spin_unlock(&priv->lock); 675 spin_unlock(&priv->lock);
678 return err; 676 return err;
677
678out_put_map:
679 gntdev_put_map(map);
680 return err;
679} 681}
680 682
681static const struct file_operations gntdev_fops = { 683static const struct file_operations gntdev_fops = {