[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180726145936.3547913-2-doronrk@fb.com>
Date: Thu, 26 Jul 2018 07:59:35 -0700
From: Doron Roberts-Kedes <doronrk@...com>
To: "David S . Miller" <davem@...emloft.net>
CC: Vakul Garg <vakul.garg@....com>, Dave Watson <davejwatson@...com>,
Matt Mullins <mmullins@...com>, <netdev@...r.kernel.org>,
Doron Roberts-Kedes <doronrk@...com>
Subject: [PATCH net-next v2 1/2] 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 <doronrk@...com>
---
net/tls/tls_sw.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/net/tls/tls_sw.c b/net/tls/tls_sw.c
index 03f1370f5db1..0279bc4a168b 100644
--- a/net/tls/tls_sw.c
+++ b/net/tls/tls_sw.c
@@ -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);
--
2.17.1
Powered by blists - more mailing lists