virtualization.lists.linux-foundation.org archive mirror
 help / color / mirror / Atom feed
* [patch 2/2] xen-gntdev: unlock on error path in gntdev_mmap()
@ 2011-03-19  5:45 Dan Carpenter
  2011-03-25 15:04 ` [Xen-devel] " Konrad Rzeszutek Wilk
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2011-03-19  5:45 UTC (permalink / raw)
  To: Jeremy Fitzhardinge
  Cc: kernel-janitors, xen-devel, virtualization, Konrad Rzeszutek Wilk

We should unlock here and also decrement the number of &map->users.

Signed-off-by: Dan Carpenter <error27@gmail.com>
---
I'm not very familiar with this code.  Please review carefully.

diff --git a/drivers/xen/gntdev.c b/drivers/xen/gntdev.c
index 017ce60..b0f9e8f 100644
--- a/drivers/xen/gntdev.c
+++ b/drivers/xen/gntdev.c
@@ -662,7 +662,7 @@ static int gntdev_mmap(struct file *flip, struct vm_area_struct *vma)
 	if (map->flags) {
 		if ((vma->vm_flags & VM_WRITE) &&
 				(map->flags & GNTMAP_readonly))
-			return -EINVAL;
+			goto out_unlock_put;
 	} else {
 		map->flags = GNTMAP_host_map;
 		if (!(vma->vm_flags & VM_WRITE))
@@ -700,6 +700,8 @@ unlock_out:
 	spin_unlock(&priv->lock);
 	return err;
 
+out_unlock_put:
+	spin_unlock(&priv->lock);
 out_put_map:
 	if (use_ptemod)
 		map->vma = NULL;

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-03-25 15:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-19  5:45 [patch 2/2] xen-gntdev: unlock on error path in gntdev_mmap() Dan Carpenter
2011-03-25 15:04 ` [Xen-devel] " Konrad Rzeszutek Wilk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).