]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
ALSA: mtpav - Fix race in probe
authorTakashi Iwai <tiwai@suse.de>
Wed, 8 Oct 2008 08:28:25 +0000 (10:28 +0200)
committerJaroslav Kysela <perex@perex.cz>
Fri, 10 Oct 2008 11:41:58 +0000 (13:41 +0200)
Ingo reported Oops at probing mtpav driver.  It's a race between
the irq handler and the rawmidi instance registration.

This patch fixes the order of registration to avoid the race.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Tested-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
sound/drivers/mtpav.c

index b5e1a71bb64b59857f9a55eb9520d358cd61ed57..5b89c0883d6081b8d5b8b854d72585ef345f6c55 100644 (file)
@@ -715,6 +715,10 @@ static int __devinit snd_mtpav_probe(struct platform_device *dev)
 
        card->private_free = snd_mtpav_free;
 
+       err = snd_mtpav_get_RAWMIDI(mtp_card);
+       if (err < 0)
+               goto __error;
+
        err = snd_mtpav_get_ISA(mtp_card);
        if (err < 0)
                goto __error;
@@ -724,10 +728,6 @@ static int __devinit snd_mtpav_probe(struct platform_device *dev)
        snprintf(card->longname, sizeof(card->longname),
                 "MTPAV on parallel port at 0x%lx", port);
 
-       err = snd_mtpav_get_RAWMIDI(mtp_card);
-       if (err < 0)
-               goto __error;
-
        snd_mtpav_portscan(mtp_card);
 
        snd_card_set_dev(card, &dev->dev);