mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] net: gro: use IS_ERR before PTR_ERR
@ 2021-12-07  7:31 Guo Zhengkui
  2021-12-07 14:41 ` Alexander Lobakin
       [not found] ` <AG2AqAARE0*4ic4l2539l4rv.9.1638888118554.Hmail.guozhengkui@vivo.com.@PDIwMjExMjA3MTQ0MTM3LjIyNDU0LTEtYWxleGFuZHIubG9iYWtpbkBpbnRlbC5jb20+>
  0 siblings, 2 replies; 3+ messages in thread
From: Guo Zhengkui @ 2021-12-07  7:31 UTC (permalink / raw)
  To: David S. Miller, Jakub Kicinski, Eric Dumazet, Guo Zhengkui,
	netdev, linux-kernel
  Cc: kernel

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@vivo.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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-12-08  7:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-07  7:31 [PATCH] net: gro: use IS_ERR before PTR_ERR Guo Zhengkui
2021-12-07 14:41 ` Alexander Lobakin
     [not found] ` <AG2AqAARE0*4ic4l2539l4rv.9.1638888118554.Hmail.guozhengkui@vivo.com.@PDIwMjExMjA3MTQ0MTM3LjIyNDU0LTEtYWxleGFuZHIubG9iYWtpbkBpbnRlbC5jb20+>
2021-12-08  7:09   ` Guo Zhengkui

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®