diff options
author | Colin Ian King <colin.king@canonical.com> | 2019-04-04 10:46:03 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-04-06 21:18:14 -0400 |
commit | d1edc085559744fbda7a55e97eeae8bd6135a11b (patch) | |
tree | 64bd82f21b8a038ee6a89f2ac89174d307123f87 /net/ipv4/tcp_output.c | |
parent | cdf369cd5808fccd1d10cbf68f39429709410f31 (diff) |
tcp: remove redundant check on tskb
The non-null check on tskb is always false because it is in an else
path of a check on tskb and hence tskb is null in this code block.
This is check is therefore redundant and can be removed as well
as the label coalesc.
if (tsbk) {
...
} else {
...
if (unlikely(!skb)) {
if (tskb) /* can never be true, redundant code */
goto coalesc;
return;
}
}
Addresses-Coverity: ("Logically dead code")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Mukesh Ojha <mojha@codeaurora.org>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp_output.c')
-rw-r--r-- | net/ipv4/tcp_output.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index e265d1aeeb66..32061928b054 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c | |||
@@ -3088,7 +3088,6 @@ void tcp_send_fin(struct sock *sk) | |||
3088 | tskb = skb_rb_last(&sk->tcp_rtx_queue); | 3088 | tskb = skb_rb_last(&sk->tcp_rtx_queue); |
3089 | 3089 | ||
3090 | if (tskb) { | 3090 | if (tskb) { |
3091 | coalesce: | ||
3092 | TCP_SKB_CB(tskb)->tcp_flags |= TCPHDR_FIN; | 3091 | TCP_SKB_CB(tskb)->tcp_flags |= TCPHDR_FIN; |
3093 | TCP_SKB_CB(tskb)->end_seq++; | 3092 | TCP_SKB_CB(tskb)->end_seq++; |
3094 | tp->write_seq++; | 3093 | tp->write_seq++; |
@@ -3104,11 +3103,9 @@ coalesce: | |||
3104 | } | 3103 | } |
3105 | } else { | 3104 | } else { |
3106 | skb = alloc_skb_fclone(MAX_TCP_HEADER, sk->sk_allocation); | 3105 | skb = alloc_skb_fclone(MAX_TCP_HEADER, sk->sk_allocation); |
3107 | if (unlikely(!skb)) { | 3106 | if (unlikely(!skb)) |
3108 | if (tskb) | ||
3109 | goto coalesce; | ||
3110 | return; | 3107 | return; |
3111 | } | 3108 | |
3112 | INIT_LIST_HEAD(&skb->tcp_tsorted_anchor); | 3109 | INIT_LIST_HEAD(&skb->tcp_tsorted_anchor); |
3113 | skb_reserve(skb, MAX_TCP_HEADER); | 3110 | skb_reserve(skb, MAX_TCP_HEADER); |
3114 | sk_forced_mem_schedule(sk, skb->truesize); | 3111 | sk_forced_mem_schedule(sk, skb->truesize); |