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] xen-blkfront: plug device number leak in xlblk_i

To: Laszlo Ersek <lersek@xxxxxxxxxx>, Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>, Jeremy Fitzhardinge <jeremy.fitzhardinge@xxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] xen-blkfront: plug device number leak in xlblk_init() error path
From: Ian Campbell <Ian.Campbell@xxxxxxxxxx>
Date: Mon, 10 Oct 2011 14:02:25 +0100
Cc: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Mon, 10 Oct 2011 06:05:40 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <1318016078-7110-1-git-send-email-lersek@xxxxxxxxxx>
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>
Organization: Citrix Systems, Inc.
References: <1318016078-7110-1-git-send-email-lersek@xxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Cc'ing Konrad & Jeremy per get_maintainers.pl

On Fri, 2011-10-07 at 20:34 +0100, Laszlo Ersek wrote:
> ... though after a failed xenbus_register_frontend() all may be lost.

Indeed. But anyway:

Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>

{net,kbd,fb,pci}front seem to not have this issue. Although it's not
100% clear if the effect of pci_frontend_registrar(1) needs to be
undone.

(is registrar a typo for register here?)


> Signed-off-by: Laszlo Ersek <lersek@xxxxxxxxxx>
> ---
>  drivers/block/xen-blkfront.c |   10 +++++++++-
>  1 files changed, 9 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
> index 9ea8c25..a5a9b1b 100644
> --- a/drivers/block/xen-blkfront.c
> +++ b/drivers/block/xen-blkfront.c
> @@ -1385,6 +1385,8 @@ static struct xenbus_driver blkfront = {
>  
>  static int __init xlblk_init(void)
>  {
> +     int ret;
> +
>       if (!xen_domain())
>               return -ENODEV;
>  
> @@ -1394,7 +1396,13 @@ static int __init xlblk_init(void)
>               return -ENODEV;
>       }
>  
> -     return xenbus_register_frontend(&blkfront);
> +     ret = xenbus_register_frontend(&blkfront);
> +     if (ret) {
> +             unregister_blkdev(XENVBD_MAJOR, DEV_NAME);
> +             return ret;
> +     }
> +
> +     return 0;
>  }
>  module_init(xlblk_init);
>  



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

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