Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752304AbWCFI6o (ORCPT ); Mon, 6 Mar 2006 03:58:44 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752303AbWCFI6o (ORCPT ); Mon, 6 Mar 2006 03:58:44 -0500 Received: from mx1.redhat.com ([66.187.233.31]:32232 "EHLO mx1.redhat.com") by vger.kernel.org with ESMTP id S1752302AbWCFI6n (ORCPT ); Mon, 6 Mar 2006 03:58:43 -0500 Date: Mon, 6 Mar 2006 03:58:18 -0500 From: Dave Jones To: tiwai@suse.de Cc: Linux Kernel Subject: ad1848 double free Message-ID: <20060306085817.GA32625@redhat.com> Mail-Followup-To: Dave Jones , tiwai@suse.de, Linux Kernel Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.1i Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 884 Lines: 27 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; } -- http://www.codemonkey.org.uk - 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/