[PATCH net-next] gro: avoid checking for a failed search

From: Richard Gobert
Date: Tue Nov 01 2022 - 08:01:45 EST


After searching for a protocol handler in dev_gro_receive, checking for
failure is redundant. Skip the failure code after finding the
corresponding handler.

Signed-off-by: Richard Gobert <richardbgobert@xxxxxxxxx>
---
net/core/gro.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/net/core/gro.c b/net/core/gro.c
index bc9451743307..a4e1b5a5be64 100644
--- a/net/core/gro.c
+++ b/net/core/gro.c
@@ -522,13 +522,13 @@ static enum gro_result dev_gro_receive(struct napi_struct *napi, struct sk_buff
pp = INDIRECT_CALL_INET(ptype->callbacks.gro_receive,
ipv6_gro_receive, inet_gro_receive,
&gro_list->list, skb);
- break;
+ rcu_read_unlock();
+ goto found;
}
rcu_read_unlock();
+ goto normal;

- if (&ptype->list == head)
- goto normal;
-
+found:
if (PTR_ERR(pp) == -EINPROGRESS) {
ret = GRO_CONSUMED;
goto ok;
--
2.20.1