ChangeSet 1.889.26.11, 2003/01/12 00:17:10-08:00, [EMAIL PROTECTED]
[PATCH] USB midi fixes
- correct write error path
- use GFP_ATOMIC in interrupt
diff -Nru a/drivers/usb/class/usb-midi.c b/drivers/usb/class/usb-midi.c
--- a/drivers/usb/class/usb-midi.c Mon Jan 13 14:26:04 2003
+++ b/drivers/usb/class/usb-midi.c Mon Jan 13 14:26:04 2003
@@ -337,7 +337,8 @@
if (status) {
printk(KERN_ERR "usbmidi: Cannot submit urb (%d)\n",status);
- ret = -EFAULT;
+ ret = -EIO;
+ goto error;
}
add_wait_queue( &ep->wait, &wait );
@@ -354,6 +355,7 @@
set_current_state( TASK_RUNNING );
remove_wait_queue( &ep->wait, &wait );
+error:
return ret;
}
@@ -369,7 +371,6 @@
struct midi_in_endpoint *ep = (struct midi_in_endpoint *)(urb->context);
unsigned char *data = urb->transfer_buffer;
int i, j, wake;
- unsigned long int flags;
if ( !ep->urbSubmitted ) {
return;
@@ -377,7 +378,7 @@
if ( (urb->status == 0) && (urb->actual_length > 0) ) {
wake = 0;
- spin_lock_irqsave( &ep->lock, flags );
+ spin_lock( &ep->lock );
for(j = 0; j < urb->actual_length; j += 4) {
int cin = (data[j]>>0)&0xf;
@@ -397,7 +398,7 @@
}
}
- spin_unlock_irqrestore( &ep->lock, flags );
+ spin_unlock &ep->lock );
if ( wake ) {
wake_up( &ep->wait );
}
@@ -407,7 +408,7 @@
urb->dev = ep->usbdev;
urb->actual_length = 0;
- usb_submit_urb(urb, GFP_KERNEL);
+ usb_submit_urb(urb, GFP_ATOMIC);
}
@@ -855,7 +856,6 @@
add_wait_queue( &open_wait, &wait );
up(&open_sem);
schedule();
- __set_current_state(TASK_RUNNING);
remove_wait_queue( &open_wait, &wait );
if ( signal_pending(current) ) {
return -ERESTARTSYS;
-------------------------------------------------------
This SF.NET email is sponsored by: FREE SSL Guide from Thawte
are you planning your Web Server Security? Click here to get a FREE
Thawte SSL guide and find the answers to all your SSL security issues.
http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0026en
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel