]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
tls: Remove dead code in tls_sw_sendmsg
authorDoron Roberts-Kedes <doronrk@fb.com>
Thu, 26 Jul 2018 14:59:35 +0000 (07:59 -0700)
committerDavid S. Miller <davem@davemloft.net>
Sun, 29 Jul 2018 05:53:31 +0000 (22:53 -0700)
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>
net/tls/tls_sw.c

index f9971717f7e03e88a6e56fb4096f35083fb34c58..e80d70a1e1385e832db32693d701355aab0082f7 100644 (file)
@@ -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);