diff options
author | Takashi Iwai <tiwai@suse.de> | 2008-10-08 04:28:25 -0400 |
---|---|---|
committer | Jaroslav Kysela <perex@perex.cz> | 2008-10-10 07:41:58 -0400 |
commit | 32fe61426373d85e797bf4f4dcbe4510487c3e00 (patch) | |
tree | 121f5ed0870a14d298989bc35c0ddcf03591ff3d /sound | |
parent | 59b3db6c69ae9eeed1d8fc3aee6b88272ba38ba8 (diff) |
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>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/drivers/mtpav.c | 8 |
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) | |||
715 | 715 | ||
716 | card->private_free = snd_mtpav_free; | 716 | card->private_free = snd_mtpav_free; |
717 | 717 | ||
718 | err = snd_mtpav_get_RAWMIDI(mtp_card); | ||
719 | if (err < 0) | ||
720 | goto __error; | ||
721 | |||
718 | err = snd_mtpav_get_ISA(mtp_card); | 722 | err = snd_mtpav_get_ISA(mtp_card); |
719 | if (err < 0) | 723 | if (err < 0) |
720 | goto __error; | 724 | goto __error; |
@@ -724,10 +728,6 @@ static int __devinit snd_mtpav_probe(struct platform_device *dev) | |||
724 | snprintf(card->longname, sizeof(card->longname), | 728 | snprintf(card->longname, sizeof(card->longname), |
725 | "MTPAV on parallel port at 0x%lx", port); | 729 | "MTPAV on parallel port at 0x%lx", port); |
726 | 730 | ||
727 | err = snd_mtpav_get_RAWMIDI(mtp_card); | ||
728 | if (err < 0) | ||
729 | goto __error; | ||
730 | |||
731 | snd_mtpav_portscan(mtp_card); | 731 | snd_mtpav_portscan(mtp_card); |
732 | 732 | ||
733 | snd_card_set_dev(card, &dev->dev); | 733 | snd_card_set_dev(card, &dev->dev); |