[linux-next:master 5266/5426] arch/x86/kernel/cpu/mcheck/mce.c:884:5: warning: 'order' may be used uninitialized in this function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   8225f4e85cb03daea14661380745886ce01fd83a
commit: 0dd08f12cafd7868be55bc10ebcd4ea13880860b [5266/5426] UBSAN: run-time undefined behavior sanity checker
config: x86_64-randconfig-s5-12102221 (attached as .config)
reproduce:
        git checkout 0dd08f12cafd7868be55bc10ebcd4ea13880860b
        # save the attached .config to linux build tree
        make ARCH=x86_64 

Note: it may well be a FALSE warning. FWIW you are at least aware of it now.
http://gcc.gnu.org/wiki/Better_Uninitialized_Warnings

All warnings (new ones prefixed by >>):

   arch/x86/kernel/cpu/mcheck/mce.c: In function 'do_machine_check':
>> arch/x86/kernel/cpu/mcheck/mce.c:884:5: warning: 'order' may be used uninitialized in this function [-Wmaybe-uninitialized]
     if (order == 1) {
        ^
   arch/x86/kernel/cpu/mcheck/mce.c:984:6: note: 'order' was declared here
     int order;
         ^

vim +/order +884 arch/x86/kernel/cpu/mcheck/mce.c

3c079792 Andi Kleen      2009-05-27  868   */
3c079792 Andi Kleen      2009-05-27  869  static int mce_end(int order)
3c079792 Andi Kleen      2009-05-27  870  {
3c079792 Andi Kleen      2009-05-27  871  	int ret = -1;
84c2559d Borislav Petkov 2012-10-15  872  	u64 timeout = (u64)mca_cfg.monarch_timeout * NSEC_PER_USEC;
3c079792 Andi Kleen      2009-05-27  873  
3c079792 Andi Kleen      2009-05-27  874  	if (!timeout)
3c079792 Andi Kleen      2009-05-27  875  		goto reset;
3c079792 Andi Kleen      2009-05-27  876  	if (order < 0)
3c079792 Andi Kleen      2009-05-27  877  		goto reset;
3c079792 Andi Kleen      2009-05-27  878  
3c079792 Andi Kleen      2009-05-27  879  	/*
3c079792 Andi Kleen      2009-05-27  880  	 * Allow others to run.
3c079792 Andi Kleen      2009-05-27  881  	 */
3c079792 Andi Kleen      2009-05-27  882  	atomic_inc(&mce_executing);
3c079792 Andi Kleen      2009-05-27  883  
3c079792 Andi Kleen      2009-05-27 @884  	if (order == 1) {
3c079792 Andi Kleen      2009-05-27  885  		/* CHECKME: Can this race with a parallel hotplug? */
3c079792 Andi Kleen      2009-05-27  886  		int cpus = num_online_cpus();
3c079792 Andi Kleen      2009-05-27  887  
3c079792 Andi Kleen      2009-05-27  888  		/*
3c079792 Andi Kleen      2009-05-27  889  		 * Monarch: Wait for everyone to go through their scanning
3c079792 Andi Kleen      2009-05-27  890  		 * loops.
3c079792 Andi Kleen      2009-05-27  891  		 */
3c079792 Andi Kleen      2009-05-27  892  		while (atomic_read(&mce_executing) <= cpus) {

:::::: The code at line 884 was first introduced by commit
:::::: 3c0797925f4ef9d55a32059d2af61a9c262e639d x86, mce: switch x86 machine check handler to Monarch election.

:::::: TO: Andi Kleen <andi@xxxxxxxxxxxxxx>
:::::: CC: H. Peter Anvin <hpa@xxxxxxxxx>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Attachment: .config.gz
Description: Binary data


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]