WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [patch 2/2] xen-gntdev: unlock on error path in gntdev_m

To: Dan Carpenter <error27@xxxxxxxxx>
Subject: Re: [Xen-devel] [patch 2/2] xen-gntdev: unlock on error path in gntdev_mmap()
From: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
Date: Fri, 25 Mar 2011 11:04:10 -0400
Cc: Jeremy Fitzhardinge <jeremy.fitzhardinge@xxxxxxxxxx>, kernel-janitors@xxxxxxxxxxxxxxx, xen-devel@xxxxxxxxxxxxxxxxxxx, virtualization@xxxxxxxxxxxxxxxxxxxxxxxxxx
Delivery-date: Fri, 25 Mar 2011 08:05:37 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20110319054543.GE2008@bicker>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <20110319054543.GE2008@bicker>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.20 (2009-06-14)
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@xxxxxxxxx>
> ---
> 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@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>