Commit acde891c authored by Jiasheng Jiang's avatar Jiasheng Jiang Committed by David S. Miller

rxrpc: Fix _usecs_to_jiffies() by using usecs_to_jiffies()

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: c410bf01 ("Fix the excessive initial retransmission timeout")
Signed-off-by: default avatarJiasheng Jiang <jiasheng@iscas.ac.cn>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 40bc6063
...@@ -22,7 +22,7 @@ static u32 rxrpc_rto_min_us(struct rxrpc_peer *peer) ...@@ -22,7 +22,7 @@ static u32 rxrpc_rto_min_us(struct rxrpc_peer *peer)
static u32 __rxrpc_set_rto(const 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) static u32 rxrpc_bound_rto(u32 rto)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment