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)
committerJakub Kicinski <kuba@kernel.org>
Wed, 21 Oct 2020 00:29:17 +0000 (17:29 -0700)
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>
drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_io.c

index 28c6c538032d35b4e34425f0a2d662087caaf9dd..9fb5ca6682ea23fe2b2e4d488b8d6ede74f81bbe 100644 (file)
@@ -902,9 +902,9 @@ static int chtls_skb_copy_to_page_nocache(struct sock *sk,
        return 0;
 }
 
-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,