From patchwork Tue Oct 27 13:49:25 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 312934 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1D8E0C388F9 for ; Tue, 27 Oct 2020 14:29:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D055022202 for ; Tue, 27 Oct 2020 14:29:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603808969; bh=dgnReUdtBDcIP1IBHLRt3DrRREzsidnhwYoX60Ioi/c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=B6HLM7tV2vp2QeOdp2mBDIbDcDAM7TXyYYAagtwrpxsfds/LoHQjBjFWaR1D4HAPd Dd/VR+vsAo/h8zb63gn0I2rFMPa+QXZQiYQDSXKtq3Z9CvsVOeO4Uu3RukUq8Nuwgy 7MduKfiVqo/o7xl1wg77oO3S3/Wo9o+NPQagoNAk= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759349AbgJ0O32 (ORCPT ); Tue, 27 Oct 2020 10:29:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:56096 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759344AbgJ0O31 (ORCPT ); Tue, 27 Oct 2020 10:29:27 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2711920780; Tue, 27 Oct 2020 14:29:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603808966; bh=dgnReUdtBDcIP1IBHLRt3DrRREzsidnhwYoX60Ioi/c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kBE2yuxgfuWosMOoC8nFvXBa4WPv2JcQjFrp+SkBeOsSZ5vLLJpgTZFvrIe0WNho3 YexGpEhrBYSl+fkVdWDj7dA3W2JcjDIOAEzdKr0Owlw+KRHrNIq4ilfei7ohF1w6xZ RKvvsf945aKsPV3gyjgUYsTB4V6Ic2tVLSxjpbGU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Vinay Kumar Yadav , Jakub Kicinski Subject: [PATCH 5.4 027/408] chelsio/chtls: correct function return and return type Date: Tue, 27 Oct 2020 14:49:25 +0100 Message-Id: <20201027135456.320051027@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135455.027547757@linuxfoundation.org> References: <20201027135455.027547757@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Vinay Kumar Yadav [ Upstream commit 8580a61aede28d441e1c80588803411ee86aa299 ] csk_mem_free() should return true if send buffer is available, false otherwise. Fixes: 3b8305f5c844 ("crypto: chtls - wait for memory sendmsg, sendpage") Signed-off-by: Vinay Kumar Yadav Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- drivers/crypto/chelsio/chtls/chtls_io.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/crypto/chelsio/chtls/chtls_io.c +++ b/drivers/crypto/chelsio/chtls/chtls_io.c @@ -910,9 +910,9 @@ static int tls_header_read(struct tls_hd return (__force int)cpu_to_be16(thdr->length); } -static int csk_mem_free(struct chtls_dev *cdev, struct sock *sk) +static bool csk_mem_free(struct chtls_dev *cdev, struct sock *sk) { - return (cdev->max_host_sndbuf - sk->sk_wmem_queued); + return (cdev->max_host_sndbuf - sk->sk_wmem_queued > 0); } static int csk_wait_memory(struct chtls_dev *cdev,