git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
This commit was manufactured by cvs2svn to create tag
[linux-2.6.git]
/
drivers
/
usb
/
serial
/
keyspan_pda.c
diff --git
a/drivers/usb/serial/keyspan_pda.c
b/drivers/usb/serial/keyspan_pda.c
index
2f45c60
..
cd441d7
100644
(file)
--- a/
drivers/usb/serial/keyspan_pda.c
+++ b/
drivers/usb/serial/keyspan_pda.c
@@
-285,7
+285,7
@@
static void keyspan_pda_rx_throttle (struct usb_serial_port *port)
upon the device too. */
dbg("keyspan_pda_rx_throttle port %d", port->number);
upon the device too. */
dbg("keyspan_pda_rx_throttle port %d", port->number);
- usb_
kill
_urb(port->interrupt_in_urb);
+ usb_
unlink
_urb(port->interrupt_in_urb);
}
}
@@
-493,7
+493,7
@@
static int keyspan_pda_ioctl(struct usb_serial_port *port, struct file *file,
return -ENOIOCTLCMD;
}
return -ENOIOCTLCMD;
}
-static int keyspan_pda_write(struct usb_serial_port *port,
+static int keyspan_pda_write(struct usb_serial_port *port,
int from_user,
const unsigned char *buf, int count)
{
struct usb_serial *serial = port->serial;
const unsigned char *buf, int count)
{
struct usb_serial *serial = port->serial;
@@
-567,7
+567,16
@@
static int keyspan_pda_write(struct usb_serial_port *port,
if (count) {
/* now transfer data */
if (count) {
/* now transfer data */
- memcpy (port->write_urb->transfer_buffer, buf, count);
+ if (from_user) {
+ if( copy_from_user(port->write_urb->transfer_buffer,
+ buf, count) ) {
+ rc = -EFAULT;
+ goto exit;
+ }
+ }
+ else {
+ memcpy (port->write_urb->transfer_buffer, buf, count);
+ }
/* send the data out the bulk port */
port->write_urb->transfer_buffer_length = count;
/* send the data out the bulk port */
port->write_urb->transfer_buffer_length = count;
@@
-697,8
+706,8
@@
static void keyspan_pda_close(struct usb_serial_port *port, struct file *filp)
keyspan_pda_set_modem_info(serial, 0);
/* shutdown our bulk reads and writes */
keyspan_pda_set_modem_info(serial, 0);
/* shutdown our bulk reads and writes */
- usb_
kill_urb
(port->write_urb);
- usb_
kill_urb
(port->interrupt_in_urb);
+ usb_
unlink_urb
(port->write_urb);
+ usb_
unlink_urb
(port->interrupt_in_urb);
}
}
}
}