]> Pileus Git - ~andy/linux/blobdiff - sound/isa/opti9xx/miro.c
ALSA: sound/isa/opti9xx/miro.c: eliminate possible double free
[~andy/linux] / sound / isa / opti9xx / miro.c
index c24594c866f458adbcdd155e025d4f2ba9c78ebf..4a7ff4e8985ba2fe3b71ac7b57a191e694063ae2 100644 (file)
@@ -37,6 +37,7 @@
 #include <sound/opl4.h>
 #include <sound/control.h>
 #include <sound/info.h>
+#define SNDRV_LEGACY_FIND_FREE_IOPORT
 #define SNDRV_LEGACY_FIND_FREE_IRQ
 #define SNDRV_LEGACY_FIND_FREE_DMA
 #include <sound/initval.h>
@@ -770,20 +771,6 @@ static int __devinit snd_miro_mixer(struct snd_card *card,
        return 0;
 }
 
-static long snd_legacy_find_free_ioport(long *port_table, long size)
-{
-       while (*port_table != -1) {
-               struct resource *res;
-               if ((res = request_region(*port_table, size, 
-                                         "ALSA test")) != NULL) {
-                       release_and_free_resource(res);
-                       return *port_table;
-               }
-               port_table++;
-       }
-       return -1;
-}
-
 static int __devinit snd_miro_init(struct snd_miro *chip,
                                   unsigned short hardware)
 {
@@ -1299,7 +1286,6 @@ static int __devinit snd_miro_probe(struct snd_card *card)
 
        error = snd_card_miro_aci_detect(card, miro);
        if (error < 0) {
-               snd_card_free(card);
                snd_printk(KERN_ERR "unable to detect aci chip\n");
                return -ENODEV;
        }