Skip to content

Commit 2c3fbe3

Browse files
jhovoldgregkh
authored andcommitted
net: irda: fix wait_until_sent poll timeout
In case an infinite timeout (0) is requested, the irda wait_until_sent implementation would use a zero poll timeout rather than the default 200ms. Note that wait_until_sent is currently never called with a 0-timeout argument due to a bug in tty_wait_until_sent. Fixes: 1da177e ("Linux-2.6.12-rc2") Cc: stable <stable@vger.kernel.org> # v2.6.12 Signed-off-by: Johan Hovold <johan@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 647f162 commit 2c3fbe3

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎net/irda/ircomm/ircomm_tty.c‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -798,7 +798,9 @@ static void ircomm_tty_wait_until_sent(struct tty_struct *tty, int timeout)
798798
orig_jiffies = jiffies;
799799

800800
/* Set poll time to 200 ms */
801-
poll_time = IRDA_MIN(timeout, msecs_to_jiffies(200));
801+
poll_time = msecs_to_jiffies(200);
802+
if (timeout)
803+
poll_time = min_t(unsigned long, timeout, poll_time);
802804

803805
spin_lock_irqsave(&self->spinlock, flags);
804806
while (self->tx_skb && self->tx_skb->len) {

0 commit comments

Comments
 (0)