From: Atul Gupta <atul.gupta@chelsio.com>
To: herbert@gondor.apana.org.au, linux-crypto@vger.kernel.org
Cc: gustavo@embeddedor.com, dan.carpenter@oracle.com,
netdev@vger.kernel.org, davem@davemloft.net,
atul.gupta@chelsio.com
Subject: [PATCH v2 4/5] crypto: chtls: kbuild warnings
Date: Sun, 27 May 2018 21:15:21 +0530 [thread overview]
Message-ID: <1527435922-6727-5-git-send-email-atul.gupta@chelsio.com> (raw)
In-Reply-To: <1527435922-6727-1-git-send-email-atul.gupta@chelsio.com>
- unindented continue
- check for null page
- signed return
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Atul Gupta <atul.gupta@chelsio.com>
---
drivers/crypto/chelsio/chtls/chtls_io.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/crypto/chelsio/chtls/chtls_io.c b/drivers/crypto/chelsio/chtls/chtls_io.c
index 8cfc27b..51fc682 100644
--- a/drivers/crypto/chelsio/chtls/chtls_io.c
+++ b/drivers/crypto/chelsio/chtls/chtls_io.c
@@ -907,11 +907,11 @@ static int chtls_skb_copy_to_page_nocache(struct sock *sk,
}
/* Read TLS header to find content type and data length */
-static u16 tls_header_read(struct tls_hdr *thdr, struct iov_iter *from)
+static int tls_header_read(struct tls_hdr *thdr, struct iov_iter *from)
{
if (copy_from_iter(thdr, sizeof(*thdr), from) != sizeof(*thdr))
return -EFAULT;
- return (__force u16)cpu_to_be16(thdr->length);
+ return (__force int)cpu_to_be16(thdr->length);
}
static int csk_mem_free(struct chtls_dev *cdev, struct sock *sk)
@@ -1083,9 +1083,10 @@ int chtls_sendmsg(struct sock *sk, struct msghdr *msg, size_t size)
int off = TCP_OFF(sk);
bool merge;
- if (page)
- pg_size <<= compound_order(page);
+ if (!page)
+ goto wait_for_memory;
+ pg_size <<= compound_order(page);
if (off < pg_size &&
skb_can_coalesce(skb, i, page, off)) {
merge = 1;
@@ -1492,7 +1493,7 @@ static int chtls_pt_recvmsg(struct sock *sk, struct msghdr *msg, size_t len,
break;
chtls_cleanup_rbuf(sk, copied);
sk_wait_data(sk, &timeo, NULL);
- continue;
+ continue;
found_ok_skb:
if (!skb->len) {
skb_dst_set(skb, NULL);
--
1.8.3.1
next prev parent reply other threads:[~2018-05-27 15:46 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-27 15:45 [PATCH v2 0/5] build warnings cleanup Atul Gupta
2018-05-27 15:45 ` [PATCH v2 1/5] crypto:chtls: key len correction Atul Gupta
2018-05-27 15:45 ` [PATCH v2 2/5] crypto: chtls: wait for memory sendmsg, sendpage Atul Gupta
2018-05-27 15:45 ` [PATCH v2 3/5] crypto: chtls: dereference null variable Atul Gupta
2018-05-27 15:45 ` Atul Gupta [this message]
2018-05-27 15:45 ` [PATCH v2 5/5] crypto: chtls: free beyond end rspq_skb_cache Atul Gupta
2018-05-30 16:28 ` [PATCH v2 0/5] build warnings cleanup Herbert Xu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1527435922-6727-5-git-send-email-atul.gupta@chelsio.com \
--to=atul.gupta@chelsio.com \
--cc=dan.carpenter@oracle.com \
--cc=davem@davemloft.net \
--cc=gustavo@embeddedor.com \
--cc=herbert@gondor.apana.org.au \
--cc=linux-crypto@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).