Skip to contentSkip to conversation

net: sched: cls_api: fix dead code in switch

PATCH Applied Gustavo A. R. Silva 3 participants 4 messages Jul 25, 2018 – Jul 26, 2018

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

PATCH 1/1 net: sched: cls_api: fix dead code in switch

Code at line 1850 is unreachable. Fix this by removing the break statement above it, so the code for case RTM_GETCHAIN can be properly executed.

Addresses-Coverity-ID: 1472050 ("Structurally dead code")

Fixes 32a4f5ecd738 ("net: sched: introduce chain object to uapi")
---
 net/sched/cls_api.c | 1 -
 1 file changed, 1 deletion(-)
net/sched/cls_api.c +0 -1
index 5f7098b..f3d78c2 100644
@@ -1846,7 +1846,6 @@ static int tc_ctl_chain(struct sk_buff *skb, struct nlmsghdr *n,
 		tcf_chain_put_explicitly_created(chain);
 		break;
 	case RTM_GETCHAIN:
-		break;
 		err = tc_chain_notify(chain, skb, n->nlmsg_seq,
 				      n->nlmsg_seq, n->nlmsg_type, true);
 		if (err < 0)
Signature · 1 line
2.7.4
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · Wed, Jul 25, 2018 at 04:07:24PM CEST, [email protected] wrote:

Code at line 1850 is unreachable. Fix this by removing the break statement above it, so the code for case RTM_GETCHAIN can be properly executed.

Addresses-Coverity-ID: 1472050 ("Structurally dead code")

Fixes 32a4f5ecd738 ("net: sched: introduce chain object to uapi")

I'm just writing a selftest to test this path. Thanks.

maintainer Applied
#2 lore raw
In reply to Gustavo A. R. Silva

From: "Gustavo A. R. Silva" <[email protected]>
Date: Wed, 25 Jul 2018 09:07:24 -0500

Quoted 7 lines

Code at line 1850 is unreachable. Fix this by removing the break statement above it, so the code for case RTM_GETCHAIN can be properly executed.

Addresses-Coverity-ID: 1472050 ("Structurally dead code")

Fixes 32a4f5ecd738 ("net: sched: introduce chain object to uapi")

Applied, thanks.

Please use "[PATCH net-next] ..." in your subject lines to indirect the tree that this change is relevant for and targetted to.

Thank you.

#3 lore raw
Quoted 7 lines · David Miller

From: "Gustavo A. R. Silva" <[email protected]>
Date: Wed, 25 Jul 2018 09:07:24 -0500

Quoted 4 lines

Code at line 1850 is unreachable. Fix this by removing the break statement above it, so the code for case RTM_GETCHAIN can be properly executed.

Quoted 9 lines
Quoted 3 lines

Addresses-Coverity-ID: 1472050 ("Structurally dead code")

Fixes 32a4f5ecd738 ("net: sched: introduce chain object to uapi")

Applied, thanks.

Please use "[PATCH net-next] ..." in your subject lines to indirect the tree that this change is relevant for and targetted to.

Got it. Will do next time.

Thanks
--
Gustavo