]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ALSA: mtpav - Fix initial value for input hwport
authorTakashi Iwai <tiwai@suse.de>
Wed, 11 Feb 2009 23:06:42 +0000 (00:06 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Tue, 17 Feb 2009 17:46:29 +0000 (09:46 -0800)
commit 32cf9a16f4af01573ddec1eb073111fc20a9d7d4 upstream.

Fix the initial value for input hwport.  The old value (-1) may cause
Oops when an realtime MIDI byte is received before the input port is
explicitly given.
Instead, now it's set to the broadcasting as default.

Tested-by: Holger Dehnhardt <dehnhardt@ahdehnhardt.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
sound/drivers/mtpav.c

index b5e1a71bb64b59857f9a55eb9520d358cd61ed57..04d50aa383355b3434e96e7f97dc0eeb08ac65ca 100644 (file)
@@ -706,7 +706,6 @@ static int __devinit snd_mtpav_probe(struct platform_device *dev)
        mtp_card->card = card;
        mtp_card->irq = -1;
        mtp_card->share_irq = 0;
-       mtp_card->inmidiport = 0xffffffff;
        mtp_card->inmidistate = 0;
        mtp_card->outmidihwport = 0xffffffff;
        init_timer(&mtp_card->timer);
@@ -715,6 +714,8 @@ static int __devinit snd_mtpav_probe(struct platform_device *dev)
 
        card->private_free = snd_mtpav_free;
 
+       mtp_card->inmidiport = mtp_card->num_ports + MTPAV_PIDX_BROADCAST;
+
        err = snd_mtpav_get_ISA(mtp_card);
        if (err < 0)
                goto __error;