summaryrefslogtreecommitdiffstats
path: root/drivers/staging/zram
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2010-11-04 20:07:59 -0700
committerGreg Kroah-Hartman <gregkh@suse.de>2010-11-09 16:34:01 -0800
commit5b84cc781058bb452f869d84bb24442ec51948c4 (patch)
treeaecdc5b042d434a8f5ace9adcc2fa6ad3112c533 /drivers/staging/zram
parent4eb28f7197a2cbaf7a9be778d429a5fb9bb6172e (diff)
downloadlinux-stable-5b84cc781058bb452f869d84bb24442ec51948c4.tar.gz
linux-stable-5b84cc781058bb452f869d84bb24442ec51948c4.tar.bz2
linux-stable-5b84cc781058bb452f869d84bb24442ec51948c4.zip
staging: Use vzalloc
Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/zram')
-rw-r--r--drivers/staging/zram/zram_drv.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/staging/zram/zram_drv.c b/drivers/staging/zram/zram_drv.c
index 8c3c057aa847..43fd6086bddf 100644
--- a/drivers/staging/zram/zram_drv.c
+++ b/drivers/staging/zram/zram_drv.c
@@ -533,7 +533,7 @@ int zram_init_device(struct zram *zram)
}
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 */
@@ -541,7 +541,6 @@ int zram_init_device(struct zram *zram)
ret = -ENOMEM;
goto fail;
}
- memset(zram->table, 0, num_pages * sizeof(*zram->table));
set_capacity(zram->disk, zram->disksize >> SECTOR_SHIFT);