All of lore.kernel.org
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Dan Carpenter <error27@gmail.com>
Cc: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>,
	kernel-janitors@vger.kernel.org, xen-devel@lists.xensource.com,
	virtualization@lists.linux-foundation.org
Subject: Re: [Xen-devel] [patch 2/2] xen-gntdev: unlock on error path in
Date: Fri, 25 Mar 2011 15:04:10 +0000	[thread overview]
Message-ID: <20110325150410.GF27651@dumpdata.com> (raw)
In-Reply-To: <20110319054543.GE2008@bicker>

On Sat, Mar 19, 2011 at 08:45:43AM +0300, Dan Carpenter wrote:
> 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.

It looks right. -EINVAL is still returned so that is OK. Put it
on the rc1 train.
> 
> 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;
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel

WARNING: multiple messages have this Message-ID (diff)
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Dan Carpenter <error27@gmail.com>
Cc: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>,
	kernel-janitors@vger.kernel.org, xen-devel@lists.xensource.com,
	virtualization@lists.linux-foundation.org
Subject: Re: [patch 2/2] xen-gntdev: unlock on error path in gntdev_mmap()
Date: Fri, 25 Mar 2011 11:04:10 -0400	[thread overview]
Message-ID: <20110325150410.GF27651@dumpdata.com> (raw)
In-Reply-To: <20110319054543.GE2008@bicker>

On Sat, Mar 19, 2011 at 08:45:43AM +0300, Dan Carpenter wrote:
> 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.

It looks right. -EINVAL is still returned so that is OK. Put it
on the rc1 train.
> 
> 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;
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel

  parent reply	other threads:[~2011-03-25 15:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-19  5:45 [patch 2/2] xen-gntdev: unlock on error path in gntdev_mmap() Dan Carpenter
2011-03-19  5:45 ` Dan Carpenter
2011-03-25 15:04 ` [Xen-devel] " Konrad Rzeszutek Wilk
2011-03-25 15:04 ` Konrad Rzeszutek Wilk [this message]
2011-03-25 15:04   ` Konrad Rzeszutek Wilk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110325150410.GF27651@dumpdata.com \
    --to=konrad.wilk@oracle.com \
    --cc=error27@gmail.com \
    --cc=jeremy.fitzhardinge@citrix.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=virtualization@lists.linux-foundation.org \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.