aboutsummaryrefslogtreecommitdiffstats
path: root/sound/oss/dev_table.c
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2010-12-22 12:57:02 -0500
committerJiri Kosina <jkosina@suse.cz>2010-12-22 12:57:02 -0500
commit4b7bd364700d9ac8372eff48832062b936d0793b (patch)
tree0dbf78c95456a0b02d07fcd473281f04a87e266d /sound/oss/dev_table.c
parentc0d8768af260e2cbb4bf659ae6094a262c86b085 (diff)
parent90a8a73c06cc32b609a880d48449d7083327e11a (diff)
Merge branch 'master' into for-next
Conflicts: MAINTAINERS arch/arm/mach-omap2/pm24xx.c drivers/scsi/bfa/bfa_fcpim.c Needed to update to apply fixes for which the old branch was too outdated.
Diffstat (limited to 'sound/oss/dev_table.c')
-rw-r--r--sound/oss/dev_table.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/sound/oss/dev_table.c b/sound/oss/dev_table.c
index 727bdb9ba2dc..d8cf3e58dc76 100644
--- a/sound/oss/dev_table.c
+++ b/sound/oss/dev_table.c
@@ -71,7 +71,7 @@ int sound_install_audiodrv(int vers, char *name, struct audio_driver *driver,
71 if (sound_nblocks >= MAX_MEM_BLOCKS) 71 if (sound_nblocks >= MAX_MEM_BLOCKS)
72 sound_nblocks = MAX_MEM_BLOCKS - 1; 72 sound_nblocks = MAX_MEM_BLOCKS - 1;
73 73
74 op = (struct audio_operations *) (sound_mem_blocks[sound_nblocks] = vmalloc(sizeof(struct audio_operations))); 74 op = (struct audio_operations *) (sound_mem_blocks[sound_nblocks] = vzalloc(sizeof(struct audio_operations)));
75 sound_nblocks++; 75 sound_nblocks++;
76 if (sound_nblocks >= MAX_MEM_BLOCKS) 76 if (sound_nblocks >= MAX_MEM_BLOCKS)
77 sound_nblocks = MAX_MEM_BLOCKS - 1; 77 sound_nblocks = MAX_MEM_BLOCKS - 1;
@@ -81,7 +81,6 @@ int sound_install_audiodrv(int vers, char *name, struct audio_driver *driver,
81 sound_unload_audiodev(num); 81 sound_unload_audiodev(num);
82 return -(ENOMEM); 82 return -(ENOMEM);
83 } 83 }
84 memset((char *) op, 0, sizeof(struct audio_operations));
85 init_waitqueue_head(&op->in_sleeper); 84 init_waitqueue_head(&op->in_sleeper);
86 init_waitqueue_head(&op->out_sleeper); 85 init_waitqueue_head(&op->out_sleeper);
87 init_waitqueue_head(&op->poll_sleeper); 86 init_waitqueue_head(&op->poll_sleeper);
@@ -128,7 +127,7 @@ int sound_install_mixer(int vers, char *name, struct mixer_operations *driver,
128 /* FIXME: This leaks a mixer_operations struct every time its called 127 /* FIXME: This leaks a mixer_operations struct every time its called
129 until you unload sound! */ 128 until you unload sound! */
130 129
131 op = (struct mixer_operations *) (sound_mem_blocks[sound_nblocks] = vmalloc(sizeof(struct mixer_operations))); 130 op = (struct mixer_operations *) (sound_mem_blocks[sound_nblocks] = vzalloc(sizeof(struct mixer_operations)));
132 sound_nblocks++; 131 sound_nblocks++;
133 if (sound_nblocks >= MAX_MEM_BLOCKS) 132 if (sound_nblocks >= MAX_MEM_BLOCKS)
134 sound_nblocks = MAX_MEM_BLOCKS - 1; 133 sound_nblocks = MAX_MEM_BLOCKS - 1;
@@ -137,7 +136,6 @@ int sound_install_mixer(int vers, char *name, struct mixer_operations *driver,
137 printk(KERN_ERR "Sound: Can't allocate mixer driver for (%s)\n", name); 136 printk(KERN_ERR "Sound: Can't allocate mixer driver for (%s)\n", name);
138 return -ENOMEM; 137 return -ENOMEM;
139 } 138 }
140 memset((char *) op, 0, sizeof(struct mixer_operations));
141 memcpy((char *) op, (char *) driver, driver_size); 139 memcpy((char *) op, (char *) driver, driver_size);
142 140
143 strlcpy(op->name, name, sizeof(op->name)); 141 strlcpy(op->name, name, sizeof(op->name));