]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
chelsio/chtls: correct function return and return type
authorVinay Kumar Yadav <vinay.yadav@chelsio.com>
Mon, 19 Oct 2020 11:50:24 +0000 (17:20 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 29 Oct 2020 08:54:57 +0000 (09:54 +0100)
[ 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 <vinay.yadav@chelsio.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/crypto/chelsio/chtls/chtls_io.c

index eaf5d98e8120c1ff66a1755929a74db48ef21575..e9573e7f9e8038d61ffe0221e3c0f44c016a1363 100644 (file)
@@ -914,9 +914,9 @@ static int tls_header_read(struct tls_hdr *thdr, struct iov_iter *from)
        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,