Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

sound/oss/dev_table.c: Use vzalloc

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>

authored by

Joe Perches and committed by
Takashi Iwai
f724bd24 69dbdd81

+2 -4
+2 -4
sound/oss/dev_table.c
··· 71 71 if (sound_nblocks >= MAX_MEM_BLOCKS) 72 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 75 sound_nblocks++; 76 76 if (sound_nblocks >= MAX_MEM_BLOCKS) 77 77 sound_nblocks = MAX_MEM_BLOCKS - 1; ··· 81 81 sound_unload_audiodev(num); 82 82 return -(ENOMEM); 83 83 } 84 - memset((char *) op, 0, sizeof(struct audio_operations)); 85 84 init_waitqueue_head(&op->in_sleeper); 86 85 init_waitqueue_head(&op->out_sleeper); 87 86 init_waitqueue_head(&op->poll_sleeper); ··· 127 128 /* FIXME: This leaks a mixer_operations struct every time its called 128 129 until you unload sound! */ 129 130 130 - op = (struct mixer_operations *) (sound_mem_blocks[sound_nblocks] = vmalloc(sizeof(struct mixer_operations))); 131 + op = (struct mixer_operations *) (sound_mem_blocks[sound_nblocks] = vzalloc(sizeof(struct mixer_operations))); 131 132 sound_nblocks++; 132 133 if (sound_nblocks >= MAX_MEM_BLOCKS) 133 134 sound_nblocks = MAX_MEM_BLOCKS - 1; ··· 136 137 printk(KERN_ERR "Sound: Can't allocate mixer driver for (%s)\n", name); 137 138 return -ENOMEM; 138 139 } 139 - memset((char *) op, 0, sizeof(struct mixer_operations)); 140 140 memcpy((char *) op, (char *) driver, driver_size); 141 141 142 142 strlcpy(op->name, name, sizeof(op->name));