Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932292AbWCFNwN (ORCPT ); Mon, 6 Mar 2006 08:52:13 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S932298AbWCFNwN (ORCPT ); Mon, 6 Mar 2006 08:52:13 -0500 Received: from ns.suse.de ([195.135.220.2]:27104 "EHLO mx1.suse.de") by vger.kernel.org with ESMTP id S932292AbWCFNwM (ORCPT ); Mon, 6 Mar 2006 08:52:12 -0500 Date: Mon, 06 Mar 2006 14:52:11 +0100 Message-ID: From: Takashi Iwai To: Dave Jones Cc: Linux Kernel Subject: Re: ad1848 double free In-Reply-To: <20060306085817.GA32625@redhat.com> References: <20060306085817.GA32625@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: 1184 Lines: 36 At Mon, 6 Mar 2006 03:58:18 -0500, Dave Jones wrote: > > Same again, snd_ctl_add() already kfree's on error. > > Coverity #956 > Signed-off-by: Dave Jones > > --- linux-2.6/sound/isa/ad1848/ad1848_lib.c~ 2006-03-06 03:57:22.000000000 -0500 > +++ linux-2.6/sound/isa/ad1848/ad1848_lib.c 2006-03-06 03:57:30.000000000 -0500 > @@ -1202,10 +1202,8 @@ int snd_ad1848_add_ctl(struct snd_ad1848 > strlcpy(ctl->id.name, name, sizeof(ctl->id.name)); > ctl->id.index = index; > ctl->private_value = value; > - if ((err = snd_ctl_add(chip->card, ctl)) < 0) { > - snd_ctl_free_one(ctl); > + if ((err = snd_ctl_add(chip->card, ctl)) < 0) > return err; > - } > return 0; > } Yep, both fixes for sb_mixer.c and ad1848_lib.c are correct. I also wanted to start fixing them since Andrew reported a similar bug in core/control.c, but you are much faster :) Thanks! 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/