summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorDave Jones <davej@redhat.com>2006-12-15 00:37:55 +0100
committerAdrian Bunk <bunk@stusta.de>2006-12-15 00:37:55 +0100
commit79bb71477142dd104a27a37bef36c1b1c4bbba43 (patch)
tree6cd6bb3ccb79226a2f74d4a97d9f49d4222f17a7 /sound
parent5bee6f6221c2a1b414120b2d17678ac3421d2e8b (diff)
[ALSA] ad1848 double free
snd_ctl_add() already kfree's on error. Coverity #956 Signed-off-by: Dave Jones <davej@redhat.com> Signed-off-by: Adrian Bunk <bunk@stusta.de>
Diffstat (limited to 'sound')
-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 b78530d7ea90..ed7cdb028819 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;
}