Skip to content

Commit

Permalink
x86/ptrace: Mark expected switch fall-through
Browse files Browse the repository at this point in the history
Mark switch cases where we are expecting to fall through.

Fix the following warning (Building: allnoconfig i386):

arch/x86/kernel/ptrace.c:202:6: warning: this statement may fall through [-Wimplicit-fallthrough=]
   if (unlikely(value == 0))
      ^
arch/x86/kernel/ptrace.c:206:2: note: here
  default:
  ^~~~~~~

Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Kees Cook <keescook@chromium.org>
Link: https://lkml.kernel.org/r/20190805195654.GA17831@embeddedor
  • Loading branch information
Gustavo A. R. Silva authored and Thomas Gleixner committed Aug 7, 2019
1 parent 33920f1 commit 4ab9ab6
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions arch/x86/kernel/ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ static int set_segment_reg(struct task_struct *task,
case offsetof(struct user_regs_struct, ss):
if (unlikely(value == 0))
return -EIO;
/* Else, fall through */

default:
*pt_regs_access(task_pt_regs(task), offset) = value;
Expand Down

0 comments on commit 4ab9ab6

Please sign in to comment.