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 linux-2.6.18-xen] blkback: don't call vbd_size()

To: "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, "Laszlo Ersek" <lersek@xxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH linux-2.6.18-xen] blkback: don't call vbd_size() if bd_disk is NULL
From: "Jan Beulich" <JBeulich@xxxxxxxxxx>
Date: Wed, 25 May 2011 11:36:04 +0100
Cc:
Delivery-date: Wed, 25 May 2011 03:35:23 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <4DDCD8D9.2060404@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>
References: <4DDCD8D9.2060404@xxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
>>> On 25.05.11 at 12:24, Laszlo Ersek <lersek@xxxxxxxxxx> wrote:
> ...because vbd_size() dereferences bd_disk if bd_part is NULL.
> 
> Signed-off-by: Laszlo Ersek<lersek@xxxxxxxxxx>

Acked-by: Jan Beulich <jbeulich@xxxxxxxxxx>

> ---
>   drivers/xen/blkback/vbd.c |    3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff -r 415a9b435fef drivers/xen/blkback/vbd.c
> --- a/drivers/xen/blkback/vbd.c       Mon May 23 18:36:33 2011 +0100
> +++ b/drivers/xen/blkback/vbd.c       Wed May 25 12:15:26 2011 +0200
> @@ -73,7 +73,6 @@ int vbd_create(blkif_t *blkif, blkif_vde
>       }
> 
>       vbd->bdev = bdev;
> -     vbd->size = vbd_size(vbd);
> 
>       if (vbd->bdev->bd_disk == NULL) {
>               DPRINTK("vbd_creat: device %08x doesn't exist.\n",
> @@ -82,6 +81,8 @@ int vbd_create(blkif_t *blkif, blkif_vde
>               return -ENOENT;
>       }
> 
> +     vbd->size = vbd_size(vbd);
> +
>       if (vbd->bdev->bd_disk->flags & GENHD_FL_CD || cdrom)
>               vbd->type |= VDISK_CDROM;
>       if (vbd->bdev->bd_disk->flags & GENHD_FL_REMOVABLE)
> 
> _______________________________________________
> 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>