Showing error 1693

User: Jiri Slaby
Error type: Double Lock
Error type description: Some lock is locked twice unintentionally in a sequence
File location: drivers/usb/serial/digi_acceleport.c
Line in file: 710
Project: Linux Kernel
Project version: 2.6.28
Tools: Smatch (1.59)
Entered: 2013-09-10 14:01:52 UTC


Source:

 680 *  error returned by digi_write.
 681 */
 682
 683static int digi_write_inb_command(struct usb_serial_port *port,
 684        unsigned char *buf, int count, unsigned long timeout)
 685{
 686        int ret = 0;
 687        int len;
 688        struct digi_port *priv = usb_get_serial_port_data(port);
 689        unsigned char *data = port->write_urb->transfer_buffer;
 690        unsigned long flags = 0;
 691
 692        dbg("digi_write_inb_command: TOP: port=%d, count=%d",
 693                priv->dp_port_num, count);
 694
 695        if (timeout)
 696                timeout += jiffies;
 697        else
 698                timeout = ULONG_MAX;
 699
 700        spin_lock_irqsave(&priv->dp_port_lock, flags);
 701        while (count > 0 && ret == 0) {
 702                while ((port->write_urb->status == -EINPROGRESS
 703                                || priv->dp_write_urb_in_use)
 704                                        && time_before(jiffies, timeout)) {
 705                        cond_wait_interruptible_timeout_irqrestore(
 706                                &port->write_wait, DIGI_RETRY_TIMEOUT,
 707                                &priv->dp_port_lock, flags);
 708                        if (signal_pending(current))
 709                                return -EINTR;
 710                        spin_lock_irqsave(&priv->dp_port_lock, flags);
 711                }
 712
 713                /* len must be a multiple of 4 and small enough to */
 714                /* guarantee the write will send buffered data first, */
 715                /* so commands are in order with data and not split */
 716                len = min(count, port->bulk_out_size-2-priv->dp_out_buf_len);
 717                if (len > 4)
 718                        len &= ~3;
 719
 720                /* write any buffered data first */
Show full sources