diff options
author | Atul Gupta | 2018-05-27 21:15:20 +0530 |
---|---|---|
committer | Herbert Xu | 2018-05-31 00:13:59 +0800 |
commit | ea5213b0da48474e20f84a625553028cd857d551 (patch) | |
tree | 0bb2b9e16e41a01e200b6f374c81581961544bad /drivers/crypto | |
parent | 3b8305f5c844685d00637a0ad155e90e423a4445 (diff) |
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')
-rw-r--r-- | drivers/crypto/chelsio/chtls/chtls_io.c | 3 |
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; |