Skip to content

Commit

Permalink
atm: Convert vmalloc/memset to vzalloc
Browse files Browse the repository at this point in the history
Signed-off-by: Joe Perches <[email protected]>
Signed-off-by: Jiri Kosina <[email protected]>
  • Loading branch information
JoePerches authored and Jiri Kosina committed Sep 15, 2011
1 parent dc8a5c9 commit 3a81605
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
11 changes: 6 additions & 5 deletions drivers/atm/idt77252.c
Original file line number Diff line number Diff line change
Expand Up @@ -3416,27 +3416,28 @@ init_card(struct atm_dev *dev)

size = sizeof(struct vc_map *) * card->tct_size;
IPRINTK("%s: allocate %d byte for VC map.\n", card->name, size);
if (NULL == (card->vcs = vmalloc(size))) {
card->vcs = vzalloc(size);
if (!card->vcs) {
printk("%s: memory allocation failure.\n", card->name);
deinit_card(card);
return -1;
}
memset(card->vcs, 0, size);

size = sizeof(struct vc_map *) * card->scd_size;
IPRINTK("%s: allocate %d byte for SCD to VC mapping.\n",
card->name, size);
if (NULL == (card->scd2vc = vmalloc(size))) {
card->scd2vc = vzalloc(size);
if (!card->scd2vc) {
printk("%s: memory allocation failure.\n", card->name);
deinit_card(card);
return -1;
}
memset(card->scd2vc, 0, size);

size = sizeof(struct tst_info) * (card->tst_size - 2);
IPRINTK("%s: allocate %d byte for TST to VC mapping.\n",
card->name, size);
if (NULL == (card->soft_tst = vmalloc(size))) {
card->soft_tst = vmalloc(size);
if (!card->soft_tst) {
printk("%s: memory allocation failure.\n", card->name);
deinit_card(card);
return -1;
Expand Down
3 changes: 1 addition & 2 deletions drivers/atm/lanai.c
Original file line number Diff line number Diff line change
Expand Up @@ -1457,10 +1457,9 @@ static int __devinit vcc_table_allocate(struct lanai_dev *lanai)
return (lanai->vccs == NULL) ? -ENOMEM : 0;
#else
int bytes = (lanai->num_vci) * sizeof(struct lanai_vcc *);
lanai->vccs = (struct lanai_vcc **) vmalloc(bytes);
lanai->vccs = vzalloc(bytes);
if (unlikely(lanai->vccs == NULL))
return -ENOMEM;
memset(lanai->vccs, 0, bytes);
return 0;
#endif
}
Expand Down

0 comments on commit 3a81605

Please sign in to comment.