]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/commitdiff
crypto: chtls: dereference null variable
authorAtul Gupta <atul.gupta@chelsio.com>
Sun, 27 May 2018 15:45:20 +0000 (21:15 +0530)
committerDavid S. Miller <davem@davemloft.net>
Tue, 29 May 2018 14:14:38 +0000 (10:14 -0400)
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: David S. Miller <davem@davemloft.net>
drivers/crypto/chelsio/chtls/chtls_io.c

index b6f2607f624e84979f9b59ef2eaea39d0a3bf29f..45107726308f4c3bf1db5582ae14a2d9b1563444 100644 (file)
@@ -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;