[PATCH net-next] net: filter: mark expected switch fall-through

Subsystems: bpf [general] (safe dynamic programs and tools), bpf [networking] (tcx & tc bpf, sock_addr), networking [general], the rest

STALE2920d

2 messages, 2 authors, 2018-08-14 · open the first message on its own page

[PATCH net-next] net: filter: mark expected switch fall-through

From: Gustavo A. R. Silva <hidden>
Date: 2018-08-14 16:20:49

In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.

Addresses-Coverity-ID: 1472592 ("Missing break in switch")
Signed-off-by: Gustavo A. R. Silva <redacted>
---
 net/core/filter.c | 1 +
 1 file changed, 1 insertion(+)
diff --git a/net/core/filter.c b/net/core/filter.c
index 15b9d2d..fd423ce 100644
--- a/net/core/filter.c
+++ b/net/core/filter.c
@@ -7235,6 +7235,7 @@ sk_reuseport_is_valid_access(int off, int size,
 	case offsetof(struct sk_reuseport_md, eth_protocol):
 		if (size < FIELD_SIZEOF(struct sk_buff, protocol))
 			return false;
+		/* fall through */
 	case offsetof(struct sk_reuseport_md, ip_protocol):
 	case offsetof(struct sk_reuseport_md, bind_inany):
 	case offsetof(struct sk_reuseport_md, len):
-- 
2.7.4

Re: [PATCH net-next] net: filter: mark expected switch fall-through

From: David Miller <davem@davemloft.net>
Date: 2018-08-14 17:11:48

From: "Gustavo A. R. Silva" <redacted>
Date: Tue, 14 Aug 2018 11:20:21 -0500
In preparation to enabling -Wimplicit-fallthrough, mark switch cases
where we are expecting to fall through.

Addresses-Coverity-ID: 1472592 ("Missing break in switch")
Signed-off-by: Gustavo A. R. Silva <redacted>
Applied, thank you.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help