direct-io.hg

changeset 4658:d528142a1daf

bitkeeper revision 1.1384 (426d6d66A3AfjqSI_9GpheK5U1rydQ)

Fix xlvbd_device_alloc to memset() allocated memory correctly.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Mon Apr 25 22:21:26 2005 +0000 (2005-04-25)
parents 9d8f47890534
children 97d3b54f6d13
files linux-2.6.11-xen-sparse/drivers/xen/blkfront/vbd.c
line diff
     1.1 --- a/linux-2.6.11-xen-sparse/drivers/xen/blkfront/vbd.c	Mon Apr 25 16:53:12 2005 +0000
     1.2 +++ b/linux-2.6.11-xen-sparse/drivers/xen/blkfront/vbd.c	Mon Apr 25 22:21:26 2005 +0000
     1.3 @@ -102,16 +102,16 @@ static struct block_device_operations xl
     1.4  
     1.5  spinlock_t blkif_io_lock = SPIN_LOCK_UNLOCKED;
     1.6  
     1.7 -static struct lvdisk * xlvbd_device_alloc(void)
     1.8 +static struct lvdisk *xlvbd_device_alloc(void)
     1.9  {
    1.10 -    struct lvdisk *ret;
    1.11 +    struct lvdisk *disk;
    1.12  
    1.13 -    ret = kmalloc(sizeof(struct lvdisk), GFP_KERNEL);
    1.14 -    if ( ret ) {
    1.15 -        memset(ret, '\0', 0);
    1.16 -        INIT_LIST_HEAD(&ret->list);
    1.17 +    disk = kmalloc(sizeof(*disk), GFP_KERNEL);
    1.18 +    if (disk) {
    1.19 +        memset(disk, 0, sizeof(*disk));
    1.20 +        INIT_LIST_HEAD(&disk->list);
    1.21      }
    1.22 -    return ret;
    1.23 +    return disk;
    1.24  }
    1.25  
    1.26  static void xlvbd_device_free(struct lvdisk *disk)