From: Doron Roberts-Kedes Date: Thu, 26 Jul 2018 14:59:35 +0000 (-0700) Subject: tls: Remove dead code in tls_sw_sendmsg X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=5a3611efe5b3095f348c892d040202b2ae969f4e;p=openwrt%2Fstaging%2Fblogic.git tls: Remove dead code in tls_sw_sendmsg 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 Signed-off-by: David S. Miller --- diff --git a/net/tls/tls_sw.c b/net/tls/tls_sw.c index f9971717f7e0..e80d70a1e138 100644 --- a/net/tls/tls_sw.c +++ b/net/tls/tls_sw.c @@ -423,12 +423,10 @@ alloc_encrypted: 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);