1 From 2c3fbe3cf28fbd7001545a92a83b4f8acfd9fa36 Mon Sep 17 00:00:00 2001
2 From: Johan Hovold <johan@kernel.org>
3 Date: Wed, 4 Mar 2015 10:39:03 +0100
4 Subject: net: irda: fix wait_until_sent poll timeout
6 From: Johan Hovold <johan@kernel.org>
8 commit 2c3fbe3cf28fbd7001545a92a83b4f8acfd9fa36 upstream.
10 In case an infinite timeout (0) is requested, the irda wait_until_sent
11 implementation would use a zero poll timeout rather than the default
14 Note that wait_until_sent is currently never called with a 0-timeout
15 argument due to a bug in tty_wait_until_sent.
17 Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
18 Signed-off-by: Johan Hovold <johan@kernel.org>
19 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
22 net/irda/ircomm/ircomm_tty.c | 4 +++-
23 1 file changed, 3 insertions(+), 1 deletion(-)
25 --- a/net/irda/ircomm/ircomm_tty.c
26 +++ b/net/irda/ircomm/ircomm_tty.c
27 @@ -820,7 +820,9 @@ static void ircomm_tty_wait_until_sent(s
28 orig_jiffies = jiffies;
30 /* Set poll time to 200 ms */
31 - poll_time = IRDA_MIN(timeout, msecs_to_jiffies(200));
32 + poll_time = msecs_to_jiffies(200);
34 + poll_time = min_t(unsigned long, timeout, poll_time);
36 spin_lock_irqsave(&self->spinlock, flags);
37 while (self->tx_skb && self->tx_skb->len) {