This commit was manufactured by cvs2svn to create tag
[linux-2.6.git] / drivers / usb / serial / keyspan_pda.c
index 2f45c60..cd441d7 100644 (file)
@@ -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);
-       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;
 }
 
-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;
@@ -567,7 +567,16 @@ static int keyspan_pda_write(struct usb_serial_port *port,
 
        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;
                
@@ -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 */
-               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);
        }
 }