diff options
author | Joe Perches <joe@perches.com> | 2010-11-04 20:07:59 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-11-09 16:34:01 -0800 |
commit | 5b84cc781058bb452f869d84bb24442ec51948c4 (patch) | |
tree | aecdc5b042d434a8f5ace9adcc2fa6ad3112c533 /drivers/staging/zram | |
parent | 4eb28f7197a2cbaf7a9be778d429a5fb9bb6172e (diff) |
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.c | 3 |
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); |