diff options
author | Joe Perches <joe@perches.com> | 2011-05-28 13:36:23 -0400 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2011-09-15 07:55:02 -0400 |
commit | 3a816054fcd345d0fe47c666c375d372c6170371 (patch) | |
tree | 8b775cdb79a0c8d1759b4eaa7adbd57b0fae01ce /drivers/atm | |
parent | dc8a5c9935d8e63123fab0d0033f15819351d0bf (diff) |
atm: Convert vmalloc/memset to vzalloc
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/atm')
-rw-r--r-- | drivers/atm/idt77252.c | 11 | ||||
-rw-r--r-- | drivers/atm/lanai.c | 3 |
2 files changed, 7 insertions, 7 deletions
diff --git a/drivers/atm/idt77252.c b/drivers/atm/idt77252.c index be0dbfeb541c..47648535afa7 100644 --- a/drivers/atm/idt77252.c +++ b/drivers/atm/idt77252.c | |||
@@ -3416,27 +3416,28 @@ init_card(struct atm_dev *dev) | |||
3416 | 3416 | ||
3417 | size = sizeof(struct vc_map *) * card->tct_size; | 3417 | size = sizeof(struct vc_map *) * card->tct_size; |
3418 | IPRINTK("%s: allocate %d byte for VC map.\n", card->name, size); | 3418 | IPRINTK("%s: allocate %d byte for VC map.\n", card->name, size); |
3419 | if (NULL == (card->vcs = vmalloc(size))) { | 3419 | card->vcs = vzalloc(size); |
3420 | if (!card->vcs) { | ||
3420 | printk("%s: memory allocation failure.\n", card->name); | 3421 | printk("%s: memory allocation failure.\n", card->name); |
3421 | deinit_card(card); | 3422 | deinit_card(card); |
3422 | return -1; | 3423 | return -1; |
3423 | } | 3424 | } |
3424 | memset(card->vcs, 0, size); | ||
3425 | 3425 | ||
3426 | size = sizeof(struct vc_map *) * card->scd_size; | 3426 | size = sizeof(struct vc_map *) * card->scd_size; |
3427 | IPRINTK("%s: allocate %d byte for SCD to VC mapping.\n", | 3427 | IPRINTK("%s: allocate %d byte for SCD to VC mapping.\n", |
3428 | card->name, size); | 3428 | card->name, size); |
3429 | if (NULL == (card->scd2vc = vmalloc(size))) { | 3429 | card->scd2vc = vzalloc(size); |
3430 | if (!card->scd2vc) { | ||
3430 | printk("%s: memory allocation failure.\n", card->name); | 3431 | printk("%s: memory allocation failure.\n", card->name); |
3431 | deinit_card(card); | 3432 | deinit_card(card); |
3432 | return -1; | 3433 | return -1; |
3433 | } | 3434 | } |
3434 | memset(card->scd2vc, 0, size); | ||
3435 | 3435 | ||
3436 | size = sizeof(struct tst_info) * (card->tst_size - 2); | 3436 | size = sizeof(struct tst_info) * (card->tst_size - 2); |
3437 | IPRINTK("%s: allocate %d byte for TST to VC mapping.\n", | 3437 | IPRINTK("%s: allocate %d byte for TST to VC mapping.\n", |
3438 | card->name, size); | 3438 | card->name, size); |
3439 | if (NULL == (card->soft_tst = vmalloc(size))) { | 3439 | card->soft_tst = vmalloc(size); |
3440 | if (!card->soft_tst) { | ||
3440 | printk("%s: memory allocation failure.\n", card->name); | 3441 | printk("%s: memory allocation failure.\n", card->name); |
3441 | deinit_card(card); | 3442 | deinit_card(card); |
3442 | return -1; | 3443 | return -1; |
diff --git a/drivers/atm/lanai.c b/drivers/atm/lanai.c index e828c5487493..f5569699f31c 100644 --- a/drivers/atm/lanai.c +++ b/drivers/atm/lanai.c | |||
@@ -1457,10 +1457,9 @@ static int __devinit vcc_table_allocate(struct lanai_dev *lanai) | |||
1457 | return (lanai->vccs == NULL) ? -ENOMEM : 0; | 1457 | return (lanai->vccs == NULL) ? -ENOMEM : 0; |
1458 | #else | 1458 | #else |
1459 | int bytes = (lanai->num_vci) * sizeof(struct lanai_vcc *); | 1459 | int bytes = (lanai->num_vci) * sizeof(struct lanai_vcc *); |
1460 | lanai->vccs = (struct lanai_vcc **) vmalloc(bytes); | 1460 | lanai->vccs = vzalloc(bytes); |
1461 | if (unlikely(lanai->vccs == NULL)) | 1461 | if (unlikely(lanai->vccs == NULL)) |
1462 | return -ENOMEM; | 1462 | return -ENOMEM; |
1463 | memset(lanai->vccs, 0, bytes); | ||
1464 | return 0; | 1463 | return 0; |
1465 | #endif | 1464 | #endif |
1466 | } | 1465 | } |