diff options
author | Joe Perches <joe@perches.com> | 2011-05-28 13:36:26 -0400 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2011-09-15 07:55:03 -0400 |
commit | 1ac4594d88f63ba1557cc1a30ec1f915ca55b7cb (patch) | |
tree | 53dbcfcf17b0b40c18fdb6aeb8c181f665f82a99 | |
parent | 8e03bd6525d3281068519d5f6059cdcc5a67af66 (diff) |
isdn: Convert vmalloc/memset to vzalloc
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
-rw-r--r-- | drivers/isdn/i4l/isdn_common.c | 4 | ||||
-rw-r--r-- | drivers/isdn/mISDN/dsp_core.c | 3 | ||||
-rw-r--r-- | drivers/isdn/mISDN/l1oip_codec.c | 6 |
3 files changed, 5 insertions, 8 deletions
diff --git a/drivers/isdn/i4l/isdn_common.c b/drivers/isdn/i4l/isdn_common.c index 6ed82add6ffa..6ddb795e31c5 100644 --- a/drivers/isdn/i4l/isdn_common.c +++ b/drivers/isdn/i4l/isdn_common.c | |||
@@ -2308,11 +2308,11 @@ static int __init isdn_init(void) | |||
2308 | int i; | 2308 | int i; |
2309 | char tmprev[50]; | 2309 | char tmprev[50]; |
2310 | 2310 | ||
2311 | if (!(dev = vmalloc(sizeof(isdn_dev)))) { | 2311 | dev = vzalloc(sizeof(isdn_dev)); |
2312 | if (!dev) { | ||
2312 | printk(KERN_WARNING "isdn: Could not allocate device-struct.\n"); | 2313 | printk(KERN_WARNING "isdn: Could not allocate device-struct.\n"); |
2313 | return -EIO; | 2314 | return -EIO; |
2314 | } | 2315 | } |
2315 | memset((char *) dev, 0, sizeof(isdn_dev)); | ||
2316 | init_timer(&dev->timer); | 2316 | init_timer(&dev->timer); |
2317 | dev->timer.function = isdn_timer_funct; | 2317 | dev->timer.function = isdn_timer_funct; |
2318 | spin_lock_init(&dev->lock); | 2318 | spin_lock_init(&dev->lock); |
diff --git a/drivers/isdn/mISDN/dsp_core.c b/drivers/isdn/mISDN/dsp_core.c index 2877291a9ed8..0c41553ce684 100644 --- a/drivers/isdn/mISDN/dsp_core.c +++ b/drivers/isdn/mISDN/dsp_core.c | |||
@@ -1052,12 +1052,11 @@ dspcreate(struct channel_req *crq) | |||
1052 | if (crq->protocol != ISDN_P_B_L2DSP | 1052 | if (crq->protocol != ISDN_P_B_L2DSP |
1053 | && crq->protocol != ISDN_P_B_L2DSPHDLC) | 1053 | && crq->protocol != ISDN_P_B_L2DSPHDLC) |
1054 | return -EPROTONOSUPPORT; | 1054 | return -EPROTONOSUPPORT; |
1055 | ndsp = vmalloc(sizeof(struct dsp)); | 1055 | ndsp = vzalloc(sizeof(struct dsp)); |
1056 | if (!ndsp) { | 1056 | if (!ndsp) { |
1057 | printk(KERN_ERR "%s: vmalloc struct dsp failed\n", __func__); | 1057 | printk(KERN_ERR "%s: vmalloc struct dsp failed\n", __func__); |
1058 | return -ENOMEM; | 1058 | return -ENOMEM; |
1059 | } | 1059 | } |
1060 | memset(ndsp, 0, sizeof(struct dsp)); | ||
1061 | if (dsp_debug & DEBUG_DSP_CTRL) | 1060 | if (dsp_debug & DEBUG_DSP_CTRL) |
1062 | printk(KERN_DEBUG "%s: creating new dsp instance\n", __func__); | 1061 | printk(KERN_DEBUG "%s: creating new dsp instance\n", __func__); |
1063 | 1062 | ||
diff --git a/drivers/isdn/mISDN/l1oip_codec.c b/drivers/isdn/mISDN/l1oip_codec.c index bbfd1b863ed3..5a89972624d8 100644 --- a/drivers/isdn/mISDN/l1oip_codec.c +++ b/drivers/isdn/mISDN/l1oip_codec.c | |||
@@ -330,14 +330,12 @@ l1oip_4bit_alloc(int ulaw) | |||
330 | return 0; | 330 | return 0; |
331 | 331 | ||
332 | /* alloc conversion tables */ | 332 | /* alloc conversion tables */ |
333 | table_com = vmalloc(65536); | 333 | table_com = vzalloc(65536); |
334 | table_dec = vmalloc(512); | 334 | table_dec = vzalloc(512); |
335 | if (!table_com || !table_dec) { | 335 | if (!table_com || !table_dec) { |
336 | l1oip_4bit_free(); | 336 | l1oip_4bit_free(); |
337 | return -ENOMEM; | 337 | return -ENOMEM; |
338 | } | 338 | } |
339 | memset(table_com, 0, 65536); | ||
340 | memset(table_dec, 0, 512); | ||
341 | /* generate compression table */ | 339 | /* generate compression table */ |
342 | i1 = 0; | 340 | i1 = 0; |
343 | while (i1 < 256) { | 341 | while (i1 < 256) { |