diff options
author | Atul Gupta <atul.gupta@chelsio.com> | 2018-05-27 11:45:20 -0400 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2018-05-30 12:13:59 -0400 |
commit | ea5213b0da48474e20f84a625553028cd857d551 (patch) | |
tree | 0bb2b9e16e41a01e200b6f374c81581961544bad | |
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>
-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, | |||
1230 | struct sk_buff *skb = skb_peek_tail(&csk->txq); | 1230 | struct sk_buff *skb = skb_peek_tail(&csk->txq); |
1231 | int copy, i; | 1231 | int copy, i; |
1232 | 1232 | ||
1233 | copy = mss - skb->len; | ||
1234 | if (!skb || (ULP_SKB_CB(skb)->flags & ULPCB_FLAG_NO_APPEND) || | 1233 | if (!skb || (ULP_SKB_CB(skb)->flags & ULPCB_FLAG_NO_APPEND) || |
1235 | copy <= 0) { | 1234 | (copy = mss - skb->len) <= 0) { |
1236 | new_buf: | 1235 | new_buf: |
1237 | if (!csk_mem_free(cdev, sk)) | 1236 | if (!csk_mem_free(cdev, sk)) |
1238 | goto wait_for_sndbuf; | 1237 | goto wait_for_sndbuf; |