]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[ALSA] fix usbmixer double kfree
authorDave Jones <davej@redhat.com>
Mon, 6 Mar 2006 12:26:10 +0000 (13:26 +0100)
committerJaroslav Kysela <perex@suse.cz>
Wed, 22 Mar 2006 09:35:19 +0000 (10:35 +0100)
Modules: USB generic driver

snd_ctl_add() kfree's the kcontrol already if we fail there,
so this driver is currently doing a double kfree.

Coverity bug #959

Signed-off-by: Dave Jones <davej@redhat.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/usb/usbmixer.c

index 678dac2d4dba56b6dee4c8574033590e756f6512..0bfea72373957e2d49982b61455aa694c76143b7 100644 (file)
@@ -434,7 +434,6 @@ static int add_control_to_empty(struct mixer_build *state, struct snd_kcontrol *
                kctl->id.index++;
        if ((err = snd_ctl_add(state->chip->card, kctl)) < 0) {
                snd_printd(KERN_ERR "cannot add control (err = %d)\n", err);
-               snd_ctl_free_one(kctl);
                return err;
        }
        cval->elem_id = &kctl->id;