lkml.org 
[lkml]   [2019]   [Jul]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subjectptrace.c:202:6: warning: this statement may fall through
While compiling mainline with gcc-9.1.1 the following warning is emitted:

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

The patch below silences the warning, but I don't know if this is actual
intended behaviour.

Christian.

diff --git a/arch/x86/kernel/ptrace.c b/arch/x86/kernel/ptrace.c
index 0fdbe89d0754..0030456d6e5c 100644
--- a/arch/x86/kernel/ptrace.c
+++ b/arch/x86/kernel/ptrace.c
@@ -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;
+ /* fall through */

default:
*pt_regs_access(task_pt_regs(task), offset) = value;
--
BOFH excuse #326:
We need a licensed electrician to replace the light bulbs in the computer room.

\
 
 \ /
  Last update: 2019-07-31 01:35    [W:0.026 / U:0.880 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site