[ALSA] Fix double free in error path of miro driver
authorTakashi Iwai <tiwai@suse.de>
Tue, 18 Apr 2006 13:01:23 +0000 (15:01 +0200)
committerJaroslav Kysela <perex@suse.cz>
Thu, 27 Apr 2006 19:10:17 +0000 (21:10 +0200)
Fixed the double free in error path of miro driver.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/isa/opti9xx/miro.c

index 83d64bc..e6bfcf7 100644 (file)
@@ -1179,20 +1179,17 @@ static int __init snd_card_miro_aci_detect(struct snd_card *card, struct snd_mir
         /* force ACI into a known state */
        for (i = 0; i < 3; i++)
                if (aci_cmd(miro, ACI_ERROR_OP, -1, -1) < 0) {
-                       snd_card_free(card);
                        snd_printk(KERN_ERR "can't force aci into known state.\n");
                        return -ENXIO;
                }
 
        if ((miro->aci_vendor=aci_cmd(miro, ACI_READ_IDCODE, -1, -1)) < 0 ||
            (miro->aci_product=aci_cmd(miro, ACI_READ_IDCODE, -1, -1)) < 0) {
-               snd_card_free(card);
                snd_printk(KERN_ERR "can't read aci id on 0x%lx.\n", miro->aci_port);
                return -ENXIO;
        }
 
        if ((miro->aci_version=aci_cmd(miro, ACI_READ_VERSION, -1, -1)) < 0) {
-               snd_card_free(card);
                snd_printk(KERN_ERR "can't read aci version on 0x%lx.\n", 
                           miro->aci_port);
                return -ENXIO;