aboutsummaryrefslogtreecommitdiffstats
path: root/sound/core
diff options
context:
space:
mode:
Diffstat (limited to 'sound/core')
-rw-r--r--sound/core/oss/mixer_oss.c3
-rw-r--r--sound/core/oss/pcm_oss.c2
-rw-r--r--sound/core/seq/seq_device.c3
-rw-r--r--sound/core/sgbuf.c9
4 files changed, 7 insertions, 10 deletions
diff --git a/sound/core/oss/mixer_oss.c b/sound/core/oss/mixer_oss.c
index 71b5080fa66d..75a9505c7445 100644
--- a/sound/core/oss/mixer_oss.c
+++ b/sound/core/oss/mixer_oss.c
@@ -988,13 +988,12 @@ static int snd_mixer_oss_build_input(struct snd_mixer_oss *mixer, struct snd_mix
988 if (ptr->index == 0 && (kctl = snd_mixer_oss_test_id(mixer, "Capture Source", 0)) != NULL) { 988 if (ptr->index == 0 && (kctl = snd_mixer_oss_test_id(mixer, "Capture Source", 0)) != NULL) {
989 struct snd_ctl_elem_info *uinfo; 989 struct snd_ctl_elem_info *uinfo;
990 990
991 uinfo = kmalloc(sizeof(*uinfo), GFP_KERNEL); 991 uinfo = kzalloc(sizeof(*uinfo), GFP_KERNEL);
992 if (! uinfo) { 992 if (! uinfo) {
993 up_read(&mixer->card->controls_rwsem); 993 up_read(&mixer->card->controls_rwsem);
994 return -ENOMEM; 994 return -ENOMEM;
995 } 995 }
996 996
997 memset(uinfo, 0, sizeof(*uinfo));
998 if (kctl->info(kctl, uinfo)) { 997 if (kctl->info(kctl, uinfo)) {
999 up_read(&mixer->card->controls_rwsem); 998 up_read(&mixer->card->controls_rwsem);
1000 return 0; 999 return 0;
diff --git a/sound/core/oss/pcm_oss.c b/sound/core/oss/pcm_oss.c
index f5ff4f4a16ee..472fce0ee0e8 100644
--- a/sound/core/oss/pcm_oss.c
+++ b/sound/core/oss/pcm_oss.c
@@ -2228,6 +2228,8 @@ static int snd_pcm_oss_open_file(struct file *file,
2228 for (idx = 0; idx < 2; idx++) { 2228 for (idx = 0; idx < 2; idx++) {
2229 if (setup[idx].disable) 2229 if (setup[idx].disable)
2230 continue; 2230 continue;
2231 if (! pcm->streams[idx].substream_count)
2232 continue; /* no matching substream */
2231 if (idx == SNDRV_PCM_STREAM_PLAYBACK) { 2233 if (idx == SNDRV_PCM_STREAM_PLAYBACK) {
2232 if (! (f_mode & FMODE_WRITE)) 2234 if (! (f_mode & FMODE_WRITE))
2233 continue; 2235 continue;
diff --git a/sound/core/seq/seq_device.c b/sound/core/seq/seq_device.c
index 4260de90f36f..102ff548ce69 100644
--- a/sound/core/seq/seq_device.c
+++ b/sound/core/seq/seq_device.c
@@ -372,10 +372,9 @@ static struct ops_list * create_driver(char *id)
372{ 372{
373 struct ops_list *ops; 373 struct ops_list *ops;
374 374
375 ops = kmalloc(sizeof(*ops), GFP_KERNEL); 375 ops = kzalloc(sizeof(*ops), GFP_KERNEL);
376 if (ops == NULL) 376 if (ops == NULL)
377 return ops; 377 return ops;
378 memset(ops, 0, sizeof(*ops));
379 378
380 /* set up driver entry */ 379 /* set up driver entry */
381 strlcpy(ops->id, id, sizeof(ops->id)); 380 strlcpy(ops->id, id, sizeof(ops->id));
diff --git a/sound/core/sgbuf.c b/sound/core/sgbuf.c
index 6e4d4ab34632..c30669f14ac0 100644
--- a/sound/core/sgbuf.c
+++ b/sound/core/sgbuf.c
@@ -68,21 +68,18 @@ void *snd_malloc_sgbuf_pages(struct device *device,
68 68
69 dmab->area = NULL; 69 dmab->area = NULL;
70 dmab->addr = 0; 70 dmab->addr = 0;
71 dmab->private_data = sgbuf = kmalloc(sizeof(*sgbuf), GFP_KERNEL); 71 dmab->private_data = sgbuf = kzalloc(sizeof(*sgbuf), GFP_KERNEL);
72 if (! sgbuf) 72 if (! sgbuf)
73 return NULL; 73 return NULL;
74 memset(sgbuf, 0, sizeof(*sgbuf));
75 sgbuf->dev = device; 74 sgbuf->dev = device;
76 pages = snd_sgbuf_aligned_pages(size); 75 pages = snd_sgbuf_aligned_pages(size);
77 sgbuf->tblsize = sgbuf_align_table(pages); 76 sgbuf->tblsize = sgbuf_align_table(pages);
78 sgbuf->table = kmalloc(sizeof(*sgbuf->table) * sgbuf->tblsize, GFP_KERNEL); 77 sgbuf->table = kcalloc(sgbuf->tblsize, sizeof(*sgbuf->table), GFP_KERNEL);
79 if (! sgbuf->table) 78 if (! sgbuf->table)
80 goto _failed; 79 goto _failed;
81 memset(sgbuf->table, 0, sizeof(*sgbuf->table) * sgbuf->tblsize); 80 sgbuf->page_table = kcalloc(sgbuf->tblsize, sizeof(*sgbuf->page_table), GFP_KERNEL);
82 sgbuf->page_table = kmalloc(sizeof(*sgbuf->page_table) * sgbuf->tblsize, GFP_KERNEL);
83 if (! sgbuf->page_table) 81 if (! sgbuf->page_table)
84 goto _failed; 82 goto _failed;
85 memset(sgbuf->page_table, 0, sizeof(*sgbuf->page_table) * sgbuf->tblsize);
86 83
87 /* allocate each page */ 84 /* allocate each page */
88 for (i = 0; i < pages; i++) { 85 for (i = 0; i < pages; i++) {