Commit d1edc085 authored by Colin Ian King's avatar Colin Ian King Committed by David S. Miller

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: default avatarColin Ian King <colin.king@canonical.com>
Reviewed-by: default avatarMukesh Ojha <mojha@codeaurora.org>
Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent cdf369cd
...@@ -3088,7 +3088,6 @@ void tcp_send_fin(struct sock *sk) ...@@ -3088,7 +3088,6 @@ void tcp_send_fin(struct sock *sk)
tskb = skb_rb_last(&sk->tcp_rtx_queue); tskb = skb_rb_last(&sk->tcp_rtx_queue);
if (tskb) { if (tskb) {
coalesce:
TCP_SKB_CB(tskb)->tcp_flags |= TCPHDR_FIN; TCP_SKB_CB(tskb)->tcp_flags |= TCPHDR_FIN;
TCP_SKB_CB(tskb)->end_seq++; TCP_SKB_CB(tskb)->end_seq++;
tp->write_seq++; tp->write_seq++;
...@@ -3104,11 +3103,9 @@ void tcp_send_fin(struct sock *sk) ...@@ -3104,11 +3103,9 @@ void tcp_send_fin(struct sock *sk)
} }
} else { } else {
skb = alloc_skb_fclone(MAX_TCP_HEADER, sk->sk_allocation); skb = alloc_skb_fclone(MAX_TCP_HEADER, sk->sk_allocation);
if (unlikely(!skb)) { if (unlikely(!skb))
if (tskb)
goto coalesce;
return; return;
}
INIT_LIST_HEAD(&skb->tcp_tsorted_anchor); INIT_LIST_HEAD(&skb->tcp_tsorted_anchor);
skb_reserve(skb, MAX_TCP_HEADER); skb_reserve(skb, MAX_TCP_HEADER);
sk_forced_mem_schedule(sk, skb->truesize); sk_forced_mem_schedule(sk, skb->truesize);
......
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