netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] kernel: bpf: remove dead code
@ 2017-05-22 14:07 Gustavo A. R. Silva
  2017-05-22 14:38 ` David Miller
  0 siblings, 1 reply; 6+ messages in thread
From: Gustavo A. R. Silva @ 2017-05-22 14:07 UTC (permalink / raw)
  To: Alexei Starovoitov, Daniel Borkmann
  Cc: netdev, linux-kernel, Gustavo A. R. Silva

Execution cannot reach NET_IP_ALIGN inside the following statement:
ip_align = strict ? 2 : NET_IP_ALIGN

Addresses-Coverity-ID: 1409762
Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com>
---
NOTE: variable ip_align could also be removed and use value 2 directly.

 kernel/bpf/verifier.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index 1eddb71..94f6e46 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -812,7 +812,7 @@ static int check_pkt_ptr_alignment(const struct bpf_reg_state *reg,
 	 * we force this to 2 which is universally what architectures use
 	 * when they don't set CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS.
 	 */
-	ip_align = strict ? 2 : NET_IP_ALIGN;
+	ip_align = 2;
 	if ((ip_align + reg_off + off) % size != 0) {
 		verbose("misaligned packet access off %d+%d+%d size %d\n",
 			ip_align, reg_off, off, size);
-- 
2.5.0

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

end of thread, other threads:[~2017-05-22 17:00 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-22 14:07 [PATCH] kernel: bpf: remove dead code Gustavo A. R. Silva
2017-05-22 14:38 ` David Miller
2017-05-22 14:51   ` Gustavo A. R. Silva
2017-05-22 14:52   ` Daniel Borkmann
2017-05-22 16:27     ` David Miller
2017-05-22 17:00       ` Daniel Borkmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).