summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2008-10-08 10:28:25 +0200
committerJaroslav Kysela <perex@perex.cz>2008-10-10 13:41:58 +0200
commit32fe61426373d85e797bf4f4dcbe4510487c3e00 (patch)
tree121f5ed0870a14d298989bc35c0ddcf03591ff3d
parentALSA: usb-audio: dynamic detection of MIDI interfaces in uaxx-quirk (diff)
downloadlinux-32fe61426373d85e797bf4f4dcbe4510487c3e00.tar.xz
linux-32fe61426373d85e797bf4f4dcbe4510487c3e00.zip
ALSA: mtpav - Fix race in probe
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>
-rw-r--r--sound/drivers/mtpav.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sound/drivers/mtpav.c b/sound/drivers/mtpav.c
index b5e1a71bb64b..5b89c0883d60 100644
--- a/sound/drivers/mtpav.c
+++ b/sound/drivers/mtpav.c
@@ -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);