Skip to content

Commit d6bc66d

Browse files
jhovoldsashalevin
authored andcommitted
net: irda: fix wait_until_sent poll timeout
commit 2c3fbe3 upstream. 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") Signed-off-by: Johan Hovold <johan@kernel.org> Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
1 parent 13c5441 commit d6bc66d

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
@@ -816,7 +816,9 @@ static void ircomm_tty_wait_until_sent(struct tty_struct *tty, int timeout)
816816
orig_jiffies = jiffies;
817817

818818
/* Set poll time to 200 ms */
819-
poll_time = IRDA_MIN(timeout, msecs_to_jiffies(200));
819+
poll_time = msecs_to_jiffies(200);
820+
if (timeout)
821+
poll_time = min_t(unsigned long, timeout, poll_time);
820822

821823
spin_lock_irqsave(&self->spinlock, flags);
822824
while (self->tx_skb && self->tx_skb->len) {

0 commit comments

Comments
 (0)