summaryrefslogtreecommitdiff
path: root/drivers/crypto/chelsio
diff options
context:
space:
mode:
authorAtul Gupta <atul.gupta@chelsio.com>2018-05-27 18:45:20 +0300
committerHerbert Xu <herbert@gondor.apana.org.au>2018-05-30 19:13:59 +0300
commitea5213b0da48474e20f84a625553028cd857d551 (patch)
tree0bb2b9e16e41a01e200b6f374c81581961544bad /drivers/crypto/chelsio
parent3b8305f5c844685d00637a0ad155e90e423a4445 (diff)
downloadlinux-ea5213b0da48474e20f84a625553028cd857d551.tar.xz
crypto: chtls - dereference null variable
skb dereferenced before check in sendpage Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Atul Gupta <atul.gupta@chelsio.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/chelsio')
-rw-r--r--drivers/crypto/chelsio/chtls/chtls_io.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/crypto/chelsio/chtls/chtls_io.c b/drivers/crypto/chelsio/chtls/chtls_io.c
index 7aa5d90c6ebd..8cfc27b4337d 100644
--- a/drivers/crypto/chelsio/chtls/chtls_io.c
+++ b/drivers/crypto/chelsio/chtls/chtls_io.c
@@ -1230,9 +1230,8 @@ int chtls_sendpage(struct sock *sk, struct page *page,
struct sk_buff *skb = skb_peek_tail(&csk->txq);
int copy, i;
- copy = mss - skb->len;
if (!skb || (ULP_SKB_CB(skb)->flags & ULPCB_FLAG_NO_APPEND) ||
- copy <= 0) {
+ (copy = mss - skb->len) <= 0) {
new_buf:
if (!csk_mem_free(cdev, sk))
goto wait_for_sndbuf;