bitkeeper revision 1.1384 (426d6d66A3AfjqSI_9GpheK5U1rydQ)

Fix xlvbd_device_alloc to memset() allocated memory correctly.
Signed-off-by: Keir Fraser <keir@xensource.com>
This commit is contained in:
kaf24@firebug.cl.cam.ac.uk committed 2005-04-25 22:21:26 +00:00
1 parent 40873a6637
commit 820e8097bb
1 file changed
+7 -7
@@ -102,16 +102,16 @@ static struct block_device_operations xlvbd_block_fops =
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)
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.