diff options
author | Frank Gevaerts <frank.gevaerts@fks.be> | 2006-06-30 05:34:44 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-07-12 19:03:23 -0400 |
commit | b512504e5671f83638be0ddb085c4b1832f623d3 (patch) | |
tree | 188ea620ae1b8926caf6eeb28e42f4f5375d8753 | |
parent | b972b68c396cfa9f8af7e0b314e22705251bc218 (diff) |
[PATCH] USB: ipaq.c bugfixes
This patch fixes several problems in the ipaq.c driver with connecting
and disconnecting pocketpc devices:
* The read urb stayed active if the connect failed, causing nullpointer
dereferences later on.
* If a write failed, the driver continued as if nothing happened. Now it
handles that case the same way as other usb serial devices (fix by
Luiz Fernando N. Capitulino <lcapitulino@mandriva.com.br>)
Signed-off-by: Frank Gevaerts <frank.gevaerts@fks.be>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r-- | drivers/usb/serial/ipaq.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/usb/serial/ipaq.c b/drivers/usb/serial/ipaq.c index dbcfe172a5cc..c021905f0637 100644 --- a/drivers/usb/serial/ipaq.c +++ b/drivers/usb/serial/ipaq.c | |||
@@ -651,11 +651,6 @@ static int ipaq_open(struct usb_serial_port *port, struct file *filp) | |||
651 | usb_rcvbulkpipe(serial->dev, port->bulk_in_endpointAddress), | 651 | usb_rcvbulkpipe(serial->dev, port->bulk_in_endpointAddress), |
652 | port->read_urb->transfer_buffer, port->read_urb->transfer_buffer_length, | 652 | port->read_urb->transfer_buffer, port->read_urb->transfer_buffer_length, |
653 | ipaq_read_bulk_callback, port); | 653 | ipaq_read_bulk_callback, port); |
654 | result = usb_submit_urb(port->read_urb, GFP_KERNEL); | ||
655 | if (result) { | ||
656 | err("%s - failed submitting read urb, error %d", __FUNCTION__, result); | ||
657 | goto error; | ||
658 | } | ||
659 | 654 | ||
660 | /* | 655 | /* |
661 | * Send out control message observed in win98 sniffs. Not sure what | 656 | * Send out control message observed in win98 sniffs. Not sure what |
@@ -670,6 +665,11 @@ static int ipaq_open(struct usb_serial_port *port, struct file *filp) | |||
670 | usb_sndctrlpipe(serial->dev, 0), 0x22, 0x21, | 665 | usb_sndctrlpipe(serial->dev, 0), 0x22, 0x21, |
671 | 0x1, 0, NULL, 0, 100); | 666 | 0x1, 0, NULL, 0, 100); |
672 | if (result == 0) { | 667 | if (result == 0) { |
668 | result = usb_submit_urb(port->read_urb, GFP_KERNEL); | ||
669 | if (result) { | ||
670 | err("%s - failed submitting read urb, error %d", __FUNCTION__, result); | ||
671 | goto error; | ||
672 | } | ||
673 | return 0; | 673 | return 0; |
674 | } | 674 | } |
675 | } | 675 | } |
@@ -854,6 +854,7 @@ static void ipaq_write_bulk_callback(struct urb *urb, struct pt_regs *regs) | |||
854 | 854 | ||
855 | if (urb->status) { | 855 | if (urb->status) { |
856 | dbg("%s - nonzero write bulk status received: %d", __FUNCTION__, urb->status); | 856 | dbg("%s - nonzero write bulk status received: %d", __FUNCTION__, urb->status); |
857 | return; | ||
857 | } | 858 | } |
858 | 859 | ||
859 | spin_lock_irqsave(&write_list_lock, flags); | 860 | spin_lock_irqsave(&write_list_lock, flags); |