summaryrefslogtreecommitdiff
path: root/drivers/dahdi/dahdi_dynamic.c
diff options
context:
space:
mode:
authorShaun Ruffell <sruffell@digium.com>2011-01-03 18:25:09 +0000
committerShaun Ruffell <sruffell@digium.com>2011-01-03 18:25:09 +0000
commit8c148908a202a8d77fcfb6f4c31de9d273506bf9 (patch)
treead5a73c293655e9941d402068a6c7165ab526511 /drivers/dahdi/dahdi_dynamic.c
parent6dd866cd2308aa3c0453ce71d52222b9bd7c7671 (diff)
dahdi_dynamic: kmalloc/memset -> kzalloc
Signed-off-by: Shaun Ruffell <sruffell@digium.com> Acked-by: Kinsey Moore <kmoore@digium.com> git-svn-id: http://svn.asterisk.org/svn/dahdi/linux/trunk@9568 a0bf4364-ded3-4de4-8d8a-66a801d63aff
Diffstat (limited to 'drivers/dahdi/dahdi_dynamic.c')
-rw-r--r--drivers/dahdi/dahdi_dynamic.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/drivers/dahdi/dahdi_dynamic.c b/drivers/dahdi/dahdi_dynamic.c
index 14b3a73..783dfba 100644
--- a/drivers/dahdi/dahdi_dynamic.c
+++ b/drivers/dahdi/dahdi_dynamic.c
@@ -549,36 +549,28 @@ static int create_dynamic(struct dahdi_dynamic_span *dds)
return -EEXIST;
/* Allocate memory */
- d = kmalloc(sizeof(*d), GFP_KERNEL);
+ d = kzalloc(sizeof(*d), GFP_KERNEL);
if (!d)
return -ENOMEM;
- /* Zero it out */
- memset(d, 0, sizeof(*d));
-
for (x = 0; x < dds->numchans; x++) {
- d->chans[x] = kmalloc(sizeof(*d->chans[x]), GFP_KERNEL);
+ d->chans[x] = kzalloc(sizeof(*d->chans[x]), GFP_KERNEL);
if (!d->chans[x]) {
dynamic_destroy(d);
return -ENOMEM;
}
-
- memset(d->chans[x], 0, sizeof(*d->chans[x]));
}
/* Allocate message buffer with sample space and header space */
bufsize = dds->numchans * DAHDI_CHUNKSIZE + dds->numchans / 4 + 48;
- d->msgbuf = kmalloc(bufsize, GFP_KERNEL);
+ d->msgbuf = kzalloc(bufsize, GFP_KERNEL);
if (!d->msgbuf) {
dynamic_destroy(d);
return -ENOMEM;
}
- /* Zero out -- probably not needed but why not */
- memset(d->msgbuf, 0, bufsize);
-
/* Setup parameters properly assuming we're going to be okay. */
dahdi_copy_string(d->dname, dds->driver, sizeof(d->dname));
dahdi_copy_string(d->addr, dds->addr, sizeof(d->addr));