projects
/
platform
/
kernel
/
linux-exynos.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4c49ff3
)
xen/blkback: don't call vbd_size() if bd_disk is NULL
author
Laszlo Ersek
<lersek@redhat.com>
Wed, 25 May 2011 10:24:25 +0000
(12:24 +0200)
committer
Konrad Rzeszutek Wilk
<konrad.wilk@oracle.com>
Wed, 1 Jun 2011 13:28:20 +0000
(09:28 -0400)
...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>
drivers/block/xen-blkback/xenbus.c
patch
|
blob
|
history
diff --git
a/drivers/block/xen-blkback/xenbus.c
b/drivers/block/xen-blkback/xenbus.c
index 34570823355be5715c35bc86eabfc33d7ea41b83..6cc0db1bf52252f2a981544116bf419d2a6a28e6 100644
(file)
--- 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;