diff options
author | Atul Gupta <atul.gupta@chelsio.com> | 2018-05-27 17:45:20 +0200 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2018-05-30 18:13:59 +0200 |
commit | ea5213b0da48474e20f84a625553028cd857d551 (patch) | |
tree | 0bb2b9e16e41a01e200b6f374c81581961544bad /drivers/crypto/chelsio | |
parent | crypto: chtls - wait for memory sendmsg, sendpage (diff) | |
download | linux-ea5213b0da48474e20f84a625553028cd857d551.tar.xz linux-ea5213b0da48474e20f84a625553028cd857d551.zip |
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.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; |