mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
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:
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)
|
||||
|
||||