Skip to content

Commit

Permalink
ALSA: mtpav - Fix race in probe
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Takashi Iwai authored and Jaroslav Kysela committed Oct 10, 2008
1 parent 59b3db6 commit 32fe614
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions sound/drivers/mtpav.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
Expand Down

0 comments on commit 32fe614

Please sign in to comment.