linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* 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
@ 2020-05-27  2:04 kbuild test robot
  0 siblings, 0 replies; only message in thread
From: kbuild test robot @ 2020-05-27  2:04 UTC (permalink / raw)
  To: Tony Luck; +Cc: kbuild-all, linux-kernel, Borislav Petkov

[-- Attachment #1: Type: text/plain, Size: 1708 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   444fc5cde64330661bf59944c43844e7d4c2ccd8
commit: d8ecca4043f2d9d89daab7915eca8c2ec6254d0f x86/mce/dev-mcelog: Dynamically allocate space for machine check records
date:   3 months ago
config: x86_64-lkp (attached as .config)
compiler: gcc-9 (Debian 9.3.0-13) 9.3.0
reproduce (this is a W=1 build):
        git checkout d8ecca4043f2d9d89daab7915eca8c2ec6254d0f
        # save the attached .config to linux build tree
        make W=1 ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp@intel.com>

All warnings (new ones prefixed by >>, old ones prefixed by <<):

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]
346 |  strncpy(mcelog->signature, MCE_LOG_SIGNATURE, sizeof(mcelog->signature));
|  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

vim +/strncpy +346 arch/x86/kernel/cpu/mce/dev-mcelog.c

   335	
   336	static __init int dev_mcelog_init_device(void)
   337	{
   338		int mce_log_len;
   339		int err;
   340	
   341		mce_log_len = max(MCE_LOG_MIN_LEN, num_online_cpus());
   342		mcelog = kzalloc(sizeof(*mcelog) + mce_log_len * sizeof(struct mce), GFP_KERNEL);
   343		if (!mcelog)
   344			return -ENOMEM;
   345	
 > 346		strncpy(mcelog->signature, MCE_LOG_SIGNATURE, sizeof(mcelog->signature));

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 28154 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-05-27  2:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-27  2:04 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 kbuild test robot

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).