Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751330Ab0KVG77 (ORCPT ); Mon, 22 Nov 2010 01:59:59 -0500 Received: from cantor2.suse.de ([195.135.220.15]:52060 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750779Ab0KVG76 (ORCPT ); Mon, 22 Nov 2010 01:59:58 -0500 Date: Mon, 22 Nov 2010 07:59:56 +0100 Message-ID: From: Takashi Iwai To: Joe Perches Cc: Jiri Kosina , Jaroslav Kysela , alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 48/49] sound/oss/dev_table.c: Use vzalloc In-Reply-To: References: User-Agent: Wanderlust/2.15.6 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.7 Emacs/23.1 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2580 Lines: 62 At Thu, 4 Nov 2010 20:08:12 -0700, Joe Perches wrote: > > Signed-off-by: Joe Perches Thanks, applied. [Sorry to be late, this has been already applied in my tree but this reply mail wasn't triggered to be sent out until now...] Takashi > --- > sound/oss/dev_table.c | 6 ++---- > 1 files changed, 2 insertions(+), 4 deletions(-) > > diff --git a/sound/oss/dev_table.c b/sound/oss/dev_table.c > index 727bdb9..d8cf3e5 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, > if (sound_nblocks >= MAX_MEM_BLOCKS) > sound_nblocks = MAX_MEM_BLOCKS - 1; > > - op = (struct audio_operations *) (sound_mem_blocks[sound_nblocks] = vmalloc(sizeof(struct audio_operations))); > + op = (struct audio_operations *) (sound_mem_blocks[sound_nblocks] = vzalloc(sizeof(struct audio_operations))); > sound_nblocks++; > if (sound_nblocks >= MAX_MEM_BLOCKS) > sound_nblocks = MAX_MEM_BLOCKS - 1; > @@ -81,7 +81,6 @@ int sound_install_audiodrv(int vers, char *name, struct audio_driver *driver, > sound_unload_audiodev(num); > return -(ENOMEM); > } > - memset((char *) op, 0, sizeof(struct audio_operations)); > init_waitqueue_head(&op->in_sleeper); > init_waitqueue_head(&op->out_sleeper); > init_waitqueue_head(&op->poll_sleeper); > @@ -128,7 +127,7 @@ int sound_install_mixer(int vers, char *name, struct mixer_operations *driver, > /* FIXME: This leaks a mixer_operations struct every time its called > until you unload sound! */ > > - op = (struct mixer_operations *) (sound_mem_blocks[sound_nblocks] = vmalloc(sizeof(struct mixer_operations))); > + op = (struct mixer_operations *) (sound_mem_blocks[sound_nblocks] = vzalloc(sizeof(struct mixer_operations))); > sound_nblocks++; > if (sound_nblocks >= MAX_MEM_BLOCKS) > sound_nblocks = MAX_MEM_BLOCKS - 1; > @@ -137,7 +136,6 @@ int sound_install_mixer(int vers, char *name, struct mixer_operations *driver, > printk(KERN_ERR "Sound: Can't allocate mixer driver for (%s)\n", name); > return -ENOMEM; > } > - memset((char *) op, 0, sizeof(struct mixer_operations)); > memcpy((char *) op, (char *) driver, driver_size); > > strlcpy(op->name, name, sizeof(op->name)); > -- > 1.7.3.1.g432b3.dirty > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/