Merge branch 'staging-next' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh...
[~shefty/rdma-dev.git] / drivers / staging / zram / zram_drv.c
index d0e9e0207539e2c9491fc6c1de25c75dda4bd9c6..5415712f01f804bf1ed432034c98e148561324bb 100644 (file)
@@ -527,7 +527,7 @@ int zram_init_device(struct zram *zram)
        }
 
        num_pages = zram->disksize >> PAGE_SHIFT;
        }
 
        num_pages = zram->disksize >> PAGE_SHIFT;
-       zram->table = vmalloc(num_pages * sizeof(*zram->table));
+       zram->table = vzalloc(num_pages * sizeof(*zram->table));
        if (!zram->table) {
                pr_err("Error allocating zram address table\n");
                /* To prevent accessing table entries during cleanup */
        if (!zram->table) {
                pr_err("Error allocating zram address table\n");
                /* To prevent accessing table entries during cleanup */
@@ -535,7 +535,6 @@ int zram_init_device(struct zram *zram)
                ret = -ENOMEM;
                goto fail;
        }
                ret = -ENOMEM;
                goto fail;
        }
-       memset(zram->table, 0, num_pages * sizeof(*zram->table));
 
        set_capacity(zram->disk, zram->disksize >> SECTOR_SHIFT);
 
 
        set_capacity(zram->disk, zram->disksize >> SECTOR_SHIFT);