From: Doron Roberts-Kedes Subject: [PATCH net-next v2 1/2] tls: Remove dead code in tls_sw_sendmsg Date: Thu, 26 Jul 2018 07:59:35 -0700 Message-ID: <20180726145936.3547913-2-doronrk@fb.com> References: <20180726145936.3547913-1-doronrk@fb.com> Mime-Version: 1.0 Content-Type: text/plain Cc: Vakul Garg , Dave Watson , Matt Mullins , , Doron Roberts-Kedes To: "David S . Miller" Return-path: Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:34554 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730083AbeGZQRQ (ORCPT ); Thu, 26 Jul 2018 12:17:16 -0400 Received: from pps.filterd (m0044012.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w6QEsdDR022239 for ; Thu, 26 Jul 2018 08:00:02 -0700 Received: from mail.thefacebook.com ([199.201.64.23]) by mx0a-00082601.pphosted.com with ESMTP id 2kfg5082et-3 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Thu, 26 Jul 2018 08:00:02 -0700 In-Reply-To: <20180726145936.3547913-1-doronrk@fb.com> Sender: netdev-owner@vger.kernel.org List-ID: 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 --- 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