]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
[ALSA] ad1848 double free
authorDave Jones <davej@redhat.com>
Thu, 14 Dec 2006 23:37:55 +0000 (00:37 +0100)
committerAdrian Bunk <bunk@stusta.de>
Thu, 14 Dec 2006 23:37:55 +0000 (00:37 +0100)
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>
sound/isa/ad1848/ad1848_lib.c

index b78530d7ea90c984309908a5c36b8fd36e6178ed..ed7cdb028819d407b3a5aa895a75242f8c7e9d78 100644 (file)
@@ -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;
 }