summaryrefslogtreecommitdiffstats
path: root/sound/isa
diff options
context:
space:
mode:
authorDave Jones <davej@redhat.com>2006-03-06 13:31:18 +0100
committerJaroslav Kysela <perex@suse.cz>2006-03-22 10:36:08 +0100
commit3de4414e798795ef5d719622dbf12bbe27a9e72e (patch)
treeb7724eee842c7d33a8e322cab839da0ea3abc336 /sound/isa
parentbcc54f9a563f146e723ead16c76f842bcaeb694e (diff)
[ALSA] ad1848 double free
Modules: AD1848 driver Same again, snd_ctl_add() already kfree's on error. Coverity #956 Signed-off-by: Dave Jones <davej@redhat.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/isa')
-rw-r--r--sound/isa/ad1848/ad1848_lib.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/sound/isa/ad1848/ad1848_lib.c b/sound/isa/ad1848/ad1848_lib.c
index d4b0e580557..e0f8baa843b 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;
}