public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH][next] MIPS,bpf: fix missing break in switch statement
@ 2017-08-22 22:03 Colin King
  2017-08-22 22:29 ` David Daney
  0 siblings, 1 reply; 3+ messages in thread
From: Colin King @ 2017-08-22 22:03 UTC (permalink / raw)
  To: Ralf Baechle, David Daney, David S . Miller, Daniel Borkmann,
	linux-mips
  Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

There is a missing break causing a fall-through and setting
ctx.use_bbit_insns to the wrong value. Fix this by adding the
missing break.

Detected with cppcheck:
"Variable 'ctx.use_bbit_insns' is reassigned a value before the old
one has been used. 'break;' missing?"

Fixes: 8d8d18c3283f ("MIPS,bpf: Fix using smp_processor_id() in preemptible splat.")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 arch/mips/net/ebpf_jit.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/mips/net/ebpf_jit.c b/arch/mips/net/ebpf_jit.c
index 44ddc12cbb0e..7646891c4e9b 100644
--- a/arch/mips/net/ebpf_jit.c
+++ b/arch/mips/net/ebpf_jit.c
@@ -1892,6 +1892,7 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *prog)
 	case CPU_CAVIUM_OCTEON2:
 	case CPU_CAVIUM_OCTEON3:
 		ctx.use_bbit_insns = 1;
+		break;
 	default:
 		ctx.use_bbit_insns = 0;
 	}
-- 
2.14.1

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

* Re: [PATCH][next] MIPS,bpf: fix missing break in switch statement
  2017-08-22 22:03 [PATCH][next] MIPS,bpf: fix missing break in switch statement Colin King
@ 2017-08-22 22:29 ` David Daney
  2017-08-22 22:33   ` Daniel Borkmann
  0 siblings, 1 reply; 3+ messages in thread
From: David Daney @ 2017-08-22 22:29 UTC (permalink / raw)
  To: Colin King, Ralf Baechle, David Daney, David S . Miller,
	Daniel Borkmann, linux-mips
  Cc: kernel-janitors, linux-kernel

On 08/22/2017 03:03 PM, Colin King wrote:
> From: Colin Ian King <colin.king@canonical.com>
> 
> There is a missing break causing a fall-through and setting
> ctx.use_bbit_insns to the wrong value. Fix this by adding the
> missing break.
> 
> Detected with cppcheck:
> "Variable 'ctx.use_bbit_insns' is reassigned a value before the old
> one has been used. 'break;' missing?"
> 
> Fixes: 8d8d18c3283f ("MIPS,bpf: Fix using smp_processor_id() in preemptible splat.")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Crap!  That slipped through.  Thanks for fixing it.

Tested and ...

Acked-by: David Daney <david.daney@cavium.com>

> ---
>   arch/mips/net/ebpf_jit.c | 1 +
>   1 file changed, 1 insertion(+)
> 
> diff --git a/arch/mips/net/ebpf_jit.c b/arch/mips/net/ebpf_jit.c
> index 44ddc12cbb0e..7646891c4e9b 100644
> --- a/arch/mips/net/ebpf_jit.c
> +++ b/arch/mips/net/ebpf_jit.c
> @@ -1892,6 +1892,7 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *prog)
>   	case CPU_CAVIUM_OCTEON2:
>   	case CPU_CAVIUM_OCTEON3:
>   		ctx.use_bbit_insns = 1;
> +		break;
>   	default:
>   		ctx.use_bbit_insns = 0;
>   	}
> 

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

* Re: [PATCH][next] MIPS,bpf: fix missing break in switch statement
  2017-08-22 22:29 ` David Daney
@ 2017-08-22 22:33   ` Daniel Borkmann
  0 siblings, 0 replies; 3+ messages in thread
From: Daniel Borkmann @ 2017-08-22 22:33 UTC (permalink / raw)
  To: David Daney, Colin King, Ralf Baechle, David Daney,
	David S . Miller, linux-mips
  Cc: kernel-janitors, linux-kernel

On 08/23/2017 12:29 AM, David Daney wrote:
> On 08/22/2017 03:03 PM, Colin King wrote:
>> From: Colin Ian King <colin.king@canonical.com>
>>
>> There is a missing break causing a fall-through and setting
>> ctx.use_bbit_insns to the wrong value. Fix this by adding the
>> missing break.
>>
>> Detected with cppcheck:
>> "Variable 'ctx.use_bbit_insns' is reassigned a value before the old
>> one has been used. 'break;' missing?"
>>
>> Fixes: 8d8d18c3283f ("MIPS,bpf: Fix using smp_processor_id() in preemptible splat.")
>> Signed-off-by: Colin Ian King <colin.king@canonical.com>
>
> Crap!  That slipped through.  Thanks for fixing it.
>
> Tested and ...
>
> Acked-by: David Daney <david.daney@cavium.com>

Colin, can you send this with David's ACK to netdev in Cc
so it lands in patchwork? It's for net-next tree. Thanks!

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

end of thread, other threads:[~2017-08-22 22:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-08-22 22:03 [PATCH][next] MIPS,bpf: fix missing break in switch statement Colin King
2017-08-22 22:29 ` David Daney
2017-08-22 22:33   ` Daniel Borkmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox