From: Atul Gupta Date: Sun, 27 May 2018 15:45:20 +0000 (+0530) Subject: crypto: chtls - dereference null variable X-Git-Tag: Ubuntu-5.10.0-12.13~7729^2~2 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=ea5213b0da48474e20f84a625553028cd857d551;p=mirror_ubuntu-hirsute-kernel.git crypto: chtls - dereference null variable skb dereferenced before check in sendpage Reported-by: Dan Carpenter Signed-off-by: Atul Gupta Signed-off-by: Herbert Xu --- 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;