From bcc54f9a563f146e723ead16c76f842bcaeb694e Mon Sep 17 00:00:00 2001 From: Dave Jones Date: Mon, 6 Mar 2006 13:28:34 +0100 Subject: [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 Signed-off-by: Takashi Iwai --- sound/isa/sb/sb_mixer.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/sound/isa/sb/sb_mixer.c b/sound/isa/sb/sb_mixer.c index 1a6ee344ddd..490b1ca5cf5 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; } -- cgit v1.2.3-18-g5258