patch-2.4.21 linux-2.4.21/drivers/usb/usb-midi.c

Next file: linux-2.4.21/drivers/usb/usb-midi.h
Previous file: linux-2.4.21/drivers/usb/ultracam.c
Back to the patch index
Back to the overall index

diff -urN linux-2.4.20/drivers/usb/usb-midi.c linux-2.4.21/drivers/usb/usb-midi.c
@@ -370,7 +370,7 @@
 {
 	struct midi_in_endpoint *ep = (struct midi_in_endpoint *)(urb->context);
 	unsigned char *data = urb->transfer_buffer;
-	int i, l, wake;
+	int i, j, wake;
 	unsigned long int flags;
 
 	if ( !ep->urbSubmitted ) {
@@ -381,14 +381,14 @@
 		wake = 0;
 		spin_lock_irqsave( &ep->lock, flags );
 
-		for(l = 0; l < urb->actual_length; l += 4) {
-			int cin = (data[l]>>0)&0xf;
-			int cab = (data[l]>>4)&0xf;
+		for(j = 0; j < urb->actual_length; j += 4) {
+			int cin = (data[j]>>0)&0xf;
+			int cab = (data[j]>>4)&0xf;
 			struct usb_mididev *cable = ep->cables[cab];
 			if ( cable ) {
 				int len = cin_to_len[cin]; /** length of MIDI data **/
 				for (i = 0; i < len; i++) {
-					cable->min.buf[cable->min.bufWrPtr] = data[1+i];
+					cable->min.buf[cable->min.bufWrPtr] = data[1+i+j];
 					cable->min.bufWrPtr = (cable->min.bufWrPtr+1)%MIDI_IN_BUFSIZ;
 					if (cable->min.bufRemains < MIDI_IN_BUFSIZ)
 						cable->min.bufRemains += 1;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)