diff options
author | Tony Luck <[email protected]> | 2020-05-27 11:28:08 -0700 |
---|---|---|
committer | Thomas Gleixner <[email protected]> | 2020-06-11 15:19:17 +0200 |
commit | 7ccddc4613db446dc3cbb69a3763ba60ec651d13 (patch) | |
tree | 422d31f2b461c6a7b49ceef0330895dba988c107 /tools/perf/scripts/python/export-to-sqlite.py | |
parent | 17fae1294ad9d711b2c3dd0edef479d40c76a5e8 (diff) |
x86/mce/dev-mcelog: Fix -Wstringop-truncation warning about strncpy()
The kbuild test robot reported this warning:
arch/x86/kernel/cpu/mce/dev-mcelog.c: In function 'dev_mcelog_init_device':
arch/x86/kernel/cpu/mce/dev-mcelog.c:346:2: warning: 'strncpy' output \
truncated before terminating nul copying 12 bytes from a string of the \
same length [-Wstringop-truncation]
This is accurate, but I don't care that the trailing NUL character isn't
copied. The string being copied is just a magic number signature so that
crash dump tools can be sure they are decoding the right blob of memory.
Use memcpy() instead of strncpy().
Fixes: d8ecca4043f2 ("x86/mce/dev-mcelog: Dynamically allocate space for machine check records")
Reported-by: kbuild test robot <[email protected]>
Signed-off-by: Tony Luck <[email protected]>
Signed-off-by: Borislav Petkov <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Link: https://lkml.kernel.org/r/[email protected]
Diffstat (limited to 'tools/perf/scripts/python/export-to-sqlite.py')
0 files changed, 0 insertions, 0 deletions