Skip to content

Commit

Permalink
tls: Remove dead code in tls_sw_sendmsg
Browse files Browse the repository at this point in the history
tls_push_record either returns 0 on success or a negative value on failure.
This patch removes code that would only be executed if tls_push_record
were to return a positive value.

Signed-off-by: Doron Roberts-Kedes <doronrk@fb.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Doron Roberts-Kedes authored and David S. Miller committed Jul 29, 2018
1 parent 37b81dc commit 5a3611e
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions net/tls/tls_sw.c
Original file line number Diff line number Diff line change
Expand Up @@ -423,12 +423,10 @@ int tls_sw_sendmsg(struct sock *sk, struct msghdr *msg, size_t size)

copied += try_to_copy;
ret = tls_push_record(sk, msg->msg_flags, record_type);
if (!ret)
continue;
if (ret < 0)
if (ret)
goto send_end;
continue;

copied -= try_to_copy;
fallback_to_reg_send:
iov_iter_revert(&msg->msg_iter,
ctx->sg_plaintext_size - orig_size);
Expand Down

0 comments on commit 5a3611e

Please sign in to comment.