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: | 863 |
Project: | Linux Kernel |
Project version: | 2.6.28 |
Tools: |
Clang Static Analyzer
(3.0)
Smatch (1.59) |
Entered: | 2012-04-17 12:29:30 UTC |
833 834static int digi_transmit_idle(struct usb_serial_port *port, 835 unsigned long timeout) 836{ 837 int ret; 838 unsigned char buf[2]; 839 struct digi_port *priv = usb_get_serial_port_data(port); 840 unsigned long flags = 0; 841 842 spin_lock_irqsave(&priv->dp_port_lock, flags); 843 priv->dp_transmit_idle = 0; 844 spin_unlock_irqrestore(&priv->dp_port_lock, flags); 845 846 buf[0] = DIGI_CMD_TRANSMIT_IDLE; 847 buf[1] = 0; 848 849 timeout += jiffies; 850 851 ret = digi_write_inb_command(port, buf, 2, timeout - jiffies); 852 if (ret != 0) 853 return ret; 854 855 spin_lock_irqsave(&priv->dp_port_lock, flags); 856 857 while (time_before(jiffies, timeout) && !priv->dp_transmit_idle) { 858 cond_wait_interruptible_timeout_irqrestore( 859 &priv->dp_transmit_idle_wait, DIGI_RETRY_TIMEOUT, 860 &priv->dp_port_lock, flags); 861 if (signal_pending(current)) 862 return -EINTR; 863 spin_lock_irqsave(&priv->dp_port_lock, flags); 864 } 865 priv->dp_transmit_idle = 0; 866 spin_unlock_irqrestore(&priv->dp_port_lock, flags); 867 return 0; 868 869} 870 871 872static void digi_rx_throttle(struct tty_struct *tty) 873{