lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20211207073116.3856-1-guozhengkui@vivo.com>
Date:   Tue,  7 Dec 2021 15:31:09 +0800
From:   Guo Zhengkui <guozhengkui@...o.com>
To:     "David S. Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        Eric Dumazet <edumazet@...gle.com>,
        Guo Zhengkui <guozhengkui@...o.com>, netdev@...r.kernel.org,
        linux-kernel@...r.kernel.org
Cc:     kernel@...o.com
Subject: [PATCH] net: gro: use IS_ERR before PTR_ERR

fix following cocci warning:
./net/core/gro.c:493:5-12: ERROR: PTR_ERR applied after initialization to constant on line 441

Signed-off-by: Guo Zhengkui <guozhengkui@...o.com>
---
 net/core/gro.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/net/core/gro.c b/net/core/gro.c
index 8ec8b44596da..ee08f7b23793 100644
--- a/net/core/gro.c
+++ b/net/core/gro.c
@@ -490,9 +490,11 @@ static enum gro_result dev_gro_receive(struct napi_struct *napi, struct sk_buff
 	if (&ptype->list == head)
 		goto normal;
 
-	if (PTR_ERR(pp) == -EINPROGRESS) {
-		ret = GRO_CONSUMED;
-		goto ok;
+	if (IS_ERR(pp)) {
+		if (PTR_ERR(pp) == -EINPROGRESS) {
+			ret = GRO_CONSUMED;
+			goto ok;
+		}
 	}
 
 	same_flow = NAPI_GRO_CB(skb)->same_flow;
-- 
2.20.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ