[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1526295659-29839-4-git-send-email-atul.gupta@chelsio.com>
Date: Mon, 14 May 2018 16:30:57 +0530
From: Atul Gupta <atul.gupta@...lsio.com>
To: herbert@...dor.apana.org.au, linux-crypto@...r.kernel.org
Cc: gustavo@...eddedor.com, dan.carpenter@...cle.com,
netdev@...r.kernel.org, davem@...emloft.net, atul.gupta@...lsio.com
Subject: [PATCH 3/5] crypto: chtls: dereference null variable
skb dereferenced before check in sendpage
Reported-by: Dan Carpenter <dan.carpenter@...cle.com>
Signed-off-by: Atul Gupta <atul.gupta@...lsio.com>
---
drivers/crypto/chelsio/chtls/chtls_io.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/crypto/chelsio/chtls/chtls_io.c b/drivers/crypto/chelsio/chtls/chtls_io.c
index a4c7d2d..85ddc07 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;
--
1.8.3.1
Powered by blists - more mailing lists