From 3de4414e798795ef5d719622dbf12bbe27a9e72e Mon Sep 17 00:00:00 2001 From: Dave Jones Date: Mon, 6 Mar 2006 13:31:18 +0100 Subject: [PATCH] [ALSA] ad1848 double free Modules: AD1848 driver Same again, snd_ctl_add() already kfree's on error. Coverity #956 Signed-off-by: Dave Jones Signed-off-by: Takashi Iwai --- sound/isa/ad1848/ad1848_lib.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sound/isa/ad1848/ad1848_lib.c b/sound/isa/ad1848/ad1848_lib.c index d4b0e58..e0f8baa 100644 --- a/sound/isa/ad1848/ad1848_lib.c +++ b/sound/isa/ad1848/ad1848_lib.c @@ -1202,10 +1202,8 @@ int snd_ad1848_add_ctl(struct snd_ad1848 *chip, const char *name, int index, int 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; } -- 2.7.4