Commit 7819bfbb authored by Dave Jones's avatar Dave Jones Committed by Adrian Bunk

[ALSA] sound/isa/sb/sb_mixer.c double kfree

snd_ctl_add() already does the free on error.

Coverity bug #957
Signed-off-by: default avatarDave Jones <davej@redhat.com>
Signed-off-by: default avatarAdrian Bunk <bunk@stusta.de>
parent 6f6c1475
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment