]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/3.10.72/net-irda-fix-wait_until_sent-poll-timeout.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 3.10.72 / net-irda-fix-wait_until_sent-poll-timeout.patch
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
5
6 From: Johan Hovold <johan@kernel.org>
7
8 commit 2c3fbe3cf28fbd7001545a92a83b4f8acfd9fa36 upstream.
9
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
12 200ms.
13
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.
16
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>
20
21 ---
22 net/irda/ircomm/ircomm_tty.c | 4 +++-
23 1 file changed, 3 insertions(+), 1 deletion(-)
24
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;
29
30 /* Set poll time to 200 ms */
31 - poll_time = IRDA_MIN(timeout, msecs_to_jiffies(200));
32 + poll_time = msecs_to_jiffies(200);
33 + if (timeout)
34 + poll_time = min_t(unsigned long, timeout, poll_time);
35
36 spin_lock_irqsave(&self->spinlock, flags);
37 while (self->tx_skb && self->tx_skb->len) {