diff options
author | Laszlo Ersek <lersek@redhat.com> | 2011-05-25 10:24:25 (GMT) |
---|---|---|
committer | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2011-06-01 13:28:20 (GMT) |
commit | 6464920a6e30604cb71d0ecbaa20e35009bd76fb (patch) | |
tree | e4b8e6a06c6548d739176988c0bbdc21cafa40eb /drivers/block | |
parent | 4c49ff3fe128ca68dabd07537415c419ad7f82f9 (diff) | |
download | linux-6464920a6e30604cb71d0ecbaa20e35009bd76fb.tar.xz |
xen/blkback: don't call vbd_size() if bd_disk is NULL
...because vbd_size() dereferences bd_disk if bd_part is NULL.
Signed-off-by: Laszlo Ersek<lersek@redhat.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/xen-blkback/xenbus.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/block/xen-blkback/xenbus.c b/drivers/block/xen-blkback/xenbus.c index 3457082..6cc0db1 100644 --- a/drivers/block/xen-blkback/xenbus.c +++ b/drivers/block/xen-blkback/xenbus.c @@ -357,14 +357,13 @@ static int xen_vbd_create(struct xen_blkif *blkif, blkif_vdev_t handle, } vbd->bdev = bdev; - vbd->size = vbd_sz(vbd); - if (vbd->bdev->bd_disk == NULL) { DPRINTK("xen_vbd_create: device %08x doesn't exist.\n", vbd->pdevice); xen_vbd_free(vbd); return -ENOENT; } + vbd->size = vbd_sz(vbd); if (vbd->bdev->bd_disk->flags & GENHD_FL_CD || cdrom) vbd->type |= VDISK_CDROM; |