diff options
author | Greg Kroah-Hartman <gregkh@suse.de> | 2006-08-05 10:49:32 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-08-05 10:49:32 -0700 |
commit | bce896984c59bcb0804e9eccc19163dccbff064b (patch) | |
tree | ab63719956f7605967e8705c1e6a357d9b4aa2dc /sound/core/sgbuf.c | |
parent | 40a64fa8ca3f41a3178e1bdcfe9734c1ba3e175f (diff) | |
parent | 6cb53e7ed77d429531afa8d822d59909f953a771 (diff) |
Merge http://www.kernel.org/pub/scm/linux/kernel/git/perex/alsa
Diffstat (limited to 'sound/core/sgbuf.c')
-rw-r--r-- | sound/core/sgbuf.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/sound/core/sgbuf.c b/sound/core/sgbuf.c index 6e4d4ab3463..c30669f14ac 100644 --- a/sound/core/sgbuf.c +++ b/sound/core/sgbuf.c @@ -68,21 +68,18 @@ void *snd_malloc_sgbuf_pages(struct device *device, dmab->area = NULL; dmab->addr = 0; - dmab->private_data = sgbuf = kmalloc(sizeof(*sgbuf), GFP_KERNEL); + dmab->private_data = sgbuf = kzalloc(sizeof(*sgbuf), GFP_KERNEL); if (! sgbuf) return NULL; - memset(sgbuf, 0, sizeof(*sgbuf)); sgbuf->dev = device; pages = snd_sgbuf_aligned_pages(size); sgbuf->tblsize = sgbuf_align_table(pages); - sgbuf->table = kmalloc(sizeof(*sgbuf->table) * sgbuf->tblsize, GFP_KERNEL); + sgbuf->table = kcalloc(sgbuf->tblsize, sizeof(*sgbuf->table), GFP_KERNEL); if (! sgbuf->table) goto _failed; - memset(sgbuf->table, 0, sizeof(*sgbuf->table) * sgbuf->tblsize); - sgbuf->page_table = kmalloc(sizeof(*sgbuf->page_table) * sgbuf->tblsize, GFP_KERNEL); + sgbuf->page_table = kcalloc(sgbuf->tblsize, sizeof(*sgbuf->page_table), GFP_KERNEL); if (! sgbuf->page_table) goto _failed; - memset(sgbuf->page_table, 0, sizeof(*sgbuf->page_table) * sgbuf->tblsize); /* allocate each page */ for (i = 0; i < pages; i++) { |