提交 32fe6142 编写于 作者: T Takashi Iwai 提交者: Jaroslav Kysela

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: NTakashi Iwai <tiwai@suse.de>
Tested-by: NIngo Molnar <mingo@elte.hu>
Signed-off-by: NJaroslav Kysela <perex@perex.cz>
上级 59b3db6c
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册