Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750965AbWCFNnM (ORCPT ); Mon, 6 Mar 2006 08:43:12 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932244AbWCFNnM (ORCPT ); Mon, 6 Mar 2006 08:43:12 -0500 Received: from mx1.suse.de ([195.135.220.2]:3551 "EHLO mx1.suse.de") by vger.kernel.org with ESMTP id S1750965AbWCFNnM (ORCPT ); Mon, 6 Mar 2006 08:43:12 -0500 Date: Mon, 06 Mar 2006 14:43:10 +0100 Message-ID: From: Takashi Iwai To: Dave Jones Cc: Linux Kernel Subject: Re: fix usbmixer double kfree. In-Reply-To: <20060306084951.GA15905@redhat.com> References: <20060306084951.GA15905@redhat.com> User-Agent: Wanderlust/2.12.0 (Your Wildest Dreams) SEMI/1.14.6 (Maruoka) FLIM/1.14.7 (=?ISO-8859-4?Q?Sanj=F2?=) APEL/10.6 MULE XEmacs/21.5 (beta21) (corn) (+CVS-20050720) (i386-suse-linux) 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 X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1031 Lines: 34 At Mon, 6 Mar 2006 03:49:51 -0500, Dave Jones wrote: > > snd_ctl_add() kfree's the kcontrol already if we fail there, > so this driver is currently doing a double kfree. > > Coverity bug #959 > > Signed-off-by: Dave Jones > > --- linux-2.6/sound/usb/usbmixer.c~ 2006-03-06 03:40:20.000000000 -0500 > +++ linux-2.6/sound/usb/usbmixer.c 2006-03-06 03:45:03.000000000 -0500 > @@ -434,7 +434,6 @@ static int add_control_to_empty(struct m > kctl->id.index++; > if ((err = snd_ctl_add(state->chip->card, kctl)) < 0) { > snd_printd(KERN_ERR "cannot add control (err = %d)\n", err); > - snd_ctl_free_one(kctl); > return err; > } > cval->elem_id = &kctl->id; > Thanks, applied to ALSA tree now, too. Signed-off-by: Takashi Iwai Takashi - 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/