Mailing List Archive

Fix xlvbd_device_alloc to memset() allocated memory correctly.
ChangeSet 1.1384, 2005/04/25 23:21:26+01:00, kaf24@firebug.cl.cam.ac.uk

Fix xlvbd_device_alloc to memset() allocated memory correctly.
Signed-off-by: Keir Fraser <keir@xensource.com>



vbd.c | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)


diff -Nru a/linux-2.6.11-xen-sparse/drivers/xen/blkfront/vbd.c b/linux-2.6.11-xen-sparse/drivers/xen/blkfront/vbd.c
--- a/linux-2.6.11-xen-sparse/drivers/xen/blkfront/vbd.c 2005-04-25 19:03:16 -04:00
+++ b/linux-2.6.11-xen-sparse/drivers/xen/blkfront/vbd.c 2005-04-25 19:03:16 -04:00
@@ -102,16 +102,16 @@

spinlock_t blkif_io_lock = SPIN_LOCK_UNLOCKED;

-static struct lvdisk * xlvbd_device_alloc(void)
+static struct lvdisk *xlvbd_device_alloc(void)
{
- struct lvdisk *ret;
+ struct lvdisk *disk;

- ret = kmalloc(sizeof(struct lvdisk), GFP_KERNEL);
- if ( ret ) {
- memset(ret, '\0', 0);
- INIT_LIST_HEAD(&ret->list);
+ disk = kmalloc(sizeof(*disk), GFP_KERNEL);
+ if (disk) {
+ memset(disk, 0, sizeof(*disk));
+ INIT_LIST_HEAD(&disk->list);
}
- return ret;
+ return disk;
}

static void xlvbd_device_free(struct lvdisk *disk)

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