diff options
author | Dave Jones <davej@redhat.com> | 2006-03-06 13:28:34 +0100 |
---|---|---|
committer | Jaroslav Kysela <perex@suse.cz> | 2006-03-22 10:35:57 +0100 |
commit | bcc54f9a563f146e723ead16c76f842bcaeb694e (patch) | |
tree | 73a31717b1fb3d2b24f1d54c2b2684f90f51b99d /sound | |
parent | [ALSA] emu10k1_synth use after free (diff) | |
download | linux-bcc54f9a563f146e723ead16c76f842bcaeb694e.tar.xz linux-bcc54f9a563f146e723ead16c76f842bcaeb694e.zip |
[ALSA] sound/isa/sb/sb_mixer.c double kfree
Modules: SB drivers
snd_ctl_add() already does the free on error.
Coverity bug #957
Signed-off-by: Dave Jones <davej@redhat.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/isa/sb/sb_mixer.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/sound/isa/sb/sb_mixer.c b/sound/isa/sb/sb_mixer.c index 1a6ee344dddb..490b1ca5cf58 100644 --- a/sound/isa/sb/sb_mixer.c +++ b/sound/isa/sb/sb_mixer.c @@ -453,10 +453,8 @@ int snd_sbmixer_add_ctl(struct snd_sb *chip, const char *name, int index, int ty 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; } |