NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/45909 (Use of MIDI over USB interfaces crashes NetBSD)



I wrote:

>  It doesn't crash now, but it doesn't entirely work, either.  Reading
>  from USB MIDI works fine, but writing, although not flagging any errors,
>  doesn't work: nothing ever hits the synth.

Right, that was easily fixed.  I see you're making everything observe
mididev->closing to avoid having to lock things, but you've accidentally
reversed the sense of this flag in the writing routines.

Works fine with the appended patch.

-tih

Index: umidi.c
===================================================================
RCS file: /cvsroot/src/sys/dev/usb/umidi.c,v
retrieving revision 1.59
diff -u -r1.59 umidi.c
--- umidi.c     14 Feb 2012 19:28:22 -0000      1.59
+++ umidi.c     19 Feb 2012 12:28:38 -0000
@@ -391,7 +391,7 @@
 {
        struct umidi_mididev *mididev = addr;
 
-       if (!mididev->out_jack || !mididev->opened || !mididev->closing)
+       if (!mididev->out_jack || !mididev->opened || mididev->closing)
                return EIO;
        
        return out_jack_output(mididev->out_jack, msg, len, (status>>4)&0xf);
@@ -403,7 +403,7 @@
        struct umidi_mididev *mididev = addr;
        int cin;
 
-       if (!mididev->out_jack || !mididev->opened || !mididev->closing)
+       if (!mididev->out_jack || !mididev->opened || mididev->closing)
                return EIO;
 
        switch ( len ) {
@@ -422,7 +422,7 @@
        struct umidi_mididev *mididev = addr;
        int cin;
 
-       if (!mididev->out_jack || !mididev->opened || !mididev->closing)
+       if (!mididev->out_jack || !mididev->opened || mididev->closing)
                return EIO;
 
        switch ( len ) {
@@ -441,7 +441,7 @@
        struct umidi_mididev *mididev = addr;
        u_char msg = d;
 
-       if (!mididev->out_jack || !mididev->opened || !mididev->closing)
+       if (!mididev->out_jack || !mididev->opened || mididev->closing)
                return EIO;
 
        return out_jack_output(mididev->out_jack, &msg, 1, 0xf);

-- 
"The market" is a bunch of 28-year-olds who don't know anything. --Paul Krugman


Home | Main Index | Thread Index | Old Index