Commit ea5213b0 authored by Atul Gupta's avatar Atul Gupta Committed by Herbert Xu

crypto: chtls - dereference null variable

skb dereferenced before check in sendpage
Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarAtul Gupta <atul.gupta@chelsio.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 3b8305f5
...@@ -1230,9 +1230,8 @@ int chtls_sendpage(struct sock *sk, struct page *page, ...@@ -1230,9 +1230,8 @@ int chtls_sendpage(struct sock *sk, struct page *page,
struct sk_buff *skb = skb_peek_tail(&csk->txq); struct sk_buff *skb = skb_peek_tail(&csk->txq);
int copy, i; int copy, i;
copy = mss - skb->len;
if (!skb || (ULP_SKB_CB(skb)->flags & ULPCB_FLAG_NO_APPEND) || if (!skb || (ULP_SKB_CB(skb)->flags & ULPCB_FLAG_NO_APPEND) ||
copy <= 0) { (copy = mss - skb->len) <= 0) {
new_buf: new_buf:
if (!csk_mem_free(cdev, sk)) if (!csk_mem_free(cdev, sk))
goto wait_for_sndbuf; goto wait_for_sndbuf;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment