diff options
author | Jiasheng Jiang <jiasheng@iscas.ac.cn> | 2021-09-24 06:18:37 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-11-18 21:16:25 +0300 |
commit | eade470b4351f9989cac161ee96531a40fa19825 (patch) | |
tree | 6cfd6d7a6045635bffeece73e22decce24692766 /net/rxrpc | |
parent | 9fcd75ee91592bc61f19adedc26c5a40ae88352e (diff) | |
download | linux-eade470b4351f9989cac161ee96531a40fa19825.tar.xz |
rxrpc: Fix _usecs_to_jiffies() by using usecs_to_jiffies()
[ Upstream commit acde891c243c1ed85b19d4d5042bdf00914f5739 ]
Directly using _usecs_to_jiffies() might be unsafe, so it's
better to use usecs_to_jiffies() instead.
Because we can see that the result of _usecs_to_jiffies()
could be larger than MAX_JIFFY_OFFSET values without the
check of the input.
Fixes: c410bf01933e ("Fix the excessive initial retransmission timeout")
Signed-off-by: Jiasheng Jiang <jiasheng@iscas.ac.cn>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'net/rxrpc')
-rw-r--r-- | net/rxrpc/rtt.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/rxrpc/rtt.c b/net/rxrpc/rtt.c index 4e565eeab426..be61d6f5be8d 100644 --- a/net/rxrpc/rtt.c +++ b/net/rxrpc/rtt.c @@ -22,7 +22,7 @@ static u32 rxrpc_rto_min_us(struct rxrpc_peer *peer) static u32 __rxrpc_set_rto(const struct rxrpc_peer *peer) { - return _usecs_to_jiffies((peer->srtt_us >> 3) + peer->rttvar_us); + return usecs_to_jiffies((peer->srtt_us >> 3) + peer->rttvar_us); } static u32 rxrpc_bound_rto(u32 rto) |