isdn: Convert vmalloc/memset to vzalloc
Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
This commit is contained in:
parent
8e03bd6525
commit
1ac4594d88
|
@ -2308,11 +2308,11 @@ static int __init isdn_init(void)
|
||||||
int i;
|
int i;
|
||||||
char tmprev[50];
|
char tmprev[50];
|
||||||
|
|
||||||
if (!(dev = vmalloc(sizeof(isdn_dev)))) {
|
dev = vzalloc(sizeof(isdn_dev));
|
||||||
|
if (!dev) {
|
||||||
printk(KERN_WARNING "isdn: Could not allocate device-struct.\n");
|
printk(KERN_WARNING "isdn: Could not allocate device-struct.\n");
|
||||||
return -EIO;
|
return -EIO;
|
||||||
}
|
}
|
||||||
memset((char *) dev, 0, sizeof(isdn_dev));
|
|
||||||
init_timer(&dev->timer);
|
init_timer(&dev->timer);
|
||||||
dev->timer.function = isdn_timer_funct;
|
dev->timer.function = isdn_timer_funct;
|
||||||
spin_lock_init(&dev->lock);
|
spin_lock_init(&dev->lock);
|
||||||
|
|
|
@ -1052,12 +1052,11 @@ dspcreate(struct channel_req *crq)
|
||||||
if (crq->protocol != ISDN_P_B_L2DSP
|
if (crq->protocol != ISDN_P_B_L2DSP
|
||||||
&& crq->protocol != ISDN_P_B_L2DSPHDLC)
|
&& crq->protocol != ISDN_P_B_L2DSPHDLC)
|
||||||
return -EPROTONOSUPPORT;
|
return -EPROTONOSUPPORT;
|
||||||
ndsp = vmalloc(sizeof(struct dsp));
|
ndsp = vzalloc(sizeof(struct dsp));
|
||||||
if (!ndsp) {
|
if (!ndsp) {
|
||||||
printk(KERN_ERR "%s: vmalloc struct dsp failed\n", __func__);
|
printk(KERN_ERR "%s: vmalloc struct dsp failed\n", __func__);
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
memset(ndsp, 0, sizeof(struct dsp));
|
|
||||||
if (dsp_debug & DEBUG_DSP_CTRL)
|
if (dsp_debug & DEBUG_DSP_CTRL)
|
||||||
printk(KERN_DEBUG "%s: creating new dsp instance\n", __func__);
|
printk(KERN_DEBUG "%s: creating new dsp instance\n", __func__);
|
||||||
|
|
||||||
|
|
|
@ -330,14 +330,12 @@ l1oip_4bit_alloc(int ulaw)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
/* alloc conversion tables */
|
/* alloc conversion tables */
|
||||||
table_com = vmalloc(65536);
|
table_com = vzalloc(65536);
|
||||||
table_dec = vmalloc(512);
|
table_dec = vzalloc(512);
|
||||||
if (!table_com || !table_dec) {
|
if (!table_com || !table_dec) {
|
||||||
l1oip_4bit_free();
|
l1oip_4bit_free();
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
memset(table_com, 0, 65536);
|
|
||||||
memset(table_dec, 0, 512);
|
|
||||||
/* generate compression table */
|
/* generate compression table */
|
||||||
i1 = 0;
|
i1 = 0;
|
||||||
while (i1 < 256) {
|
while (i1 < 256) {
|
||||||
|
|
Reference in New Issue