Skip to contentSkip to conversation

net_sched: remove impossible conditions

PATCH Applied Dan Carpenter 3 participants 3 messages Aug 25, 2022 – Aug 27, 2022

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net_sched: remove impossible conditions

We no longer allow "handle" to be zero, so there is no need to check for that.

---
This obviously is low priority so it could go to net-next instead.

 net/sched/cls_route.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
net/sched/cls_route.c +2 -2
index 48712bc51bda..29adac7812fe 100644
@@ -488,7 +488,7 @@ static int route4_change(struct net *net, struct sk_buff *in_skb,
 	}
 
 	if (opt == NULL)
-		return handle ? -EINVAL : 0;
+		return -EINVAL;
 
 	err = nla_parse_nested_deprecated(tb, TCA_ROUTE4_MAX, opt,
 					  route4_policy, NULL);
@@ -496,7 +496,7 @@ static int route4_change(struct net *net, struct sk_buff *in_skb,
 		return err;
 
 	fold = *arg;
-	if (fold && handle && fold->handle != handle)
+	if (fold && fold->handle != handle)
 			return -EINVAL;
 
 	err = -ENOBUFS;
Signature · 1 line
2.35.1
maintainer
#1 lore raw
Quoted 6 lines · Thu, Aug 25, 2022 at 03:25:08PM CEST, [email protected] wrote:

We no longer allow "handle" to be zero, so there is no need to check for that.

---
This obviously is low priority so it could go to net-next instead.

It should. Does not fix anything.

#2 lore raw
In reply to Dan Carpenter
This patch was applied to netdev/net-next.git (master) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (master) by Jakub Kicinski <[email protected]>:

Quoted 8 lines · On Thu, 25 Aug 2022 16:25:08 +0300 you wrote:

We no longer allow "handle" to be zero, so there is no need to check for that.

---
This obviously is low priority so it could go to net-next instead.

[...]

Here is the summary with links:
- [net] net_sched: remove impossible conditions

    https://git.kernel.org/netdev/net-next/c/53a406803ca5

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html