From patchwork Thu Jul 26 14:59:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doron Roberts-Kedes X-Patchwork-Id: 949769 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=fb.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=fb.com header.i=@fb.com header.b="SlRdBNrS"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 41bwHm2LRyz9s0w for ; Fri, 27 Jul 2018 01:00:04 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731094AbeGZQRQ (ORCPT ); Thu, 26 Jul 2018 12:17:16 -0400 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=facebook; bh=Sf3ReiHgPrEVzenHENiSOSIUEoANdDtOy4eFdD+ZxMM=; b=SlRdBNrSXvWPElTB2WKKbebuohdSDInU3jFd0SLW1CftpT9sGp/L6RQ5T7FX8sAQb83x jyECHfKH2/msiPAjCzEKQuJeNZdnLQE3lHDVfLEcZM/6McTVLfS/w1OSalT0WPiZpsT6 PYE4O5BrjvYLc1O6ILjT9fNlbeOLVUMg8zs= 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 Received: from mx-out.facebook.com (192.168.52.123) by mail.thefacebook.com (192.168.16.14) with Microsoft SMTP Server (TLS) id 14.3.361.1; Thu, 26 Jul 2018 08:00:01 -0700 Received: by devvm32402.prn1.facebook.com (Postfix, from userid 140145) id F025551B89C3; Thu, 26 Jul 2018 07:59:51 -0700 (PDT) Smtp-Origin-Hostprefix: devvm From: Doron Roberts-Kedes Smtp-Origin-Hostname: devvm32402.prn1.facebook.com To: "David S . Miller" CC: Vakul Garg , Dave Watson , Matt Mullins , , Doron Roberts-Kedes Smtp-Origin-Cluster: prn1c35 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> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180726145936.3547913-1-doronrk@fb.com> References: <20180726145936.3547913-1-doronrk@fb.com> X-FB-Internal: Safe MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-07-26_04:, , signatures=0 X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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);