[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH linux-2.6.18-xen] blkback: don't call vbd_size() if bd_disk is NULL



>>> 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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.