Hi Stanislaw,

[auto build test WARNING on net-next/master]
[also build test WARNING on v4.10-rc6 next-20170202]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]

url:    
https://github.com/0day-ci/linux/commits/Stanislaw-Gruszka/ethtool-do-not-vzalloc-0-on-registers-dump/20170202-194352
config: cris-etrax-100lx_v2_defconfig (attached as .config)
compiler: cris-linux-gcc (GCC) 6.2.0
reproduce:
        wget 
https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross
 -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=cris 

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

   net/core/ethtool.c: In function 'ethtool_get_feature_mask':
   net/core/ethtool.c:311:1: warning: control reaches end of non-void function 
[-Wreturn-type]
    }
    ^
   In file included from include/linux/uaccess.h:5:0,
                    from include/net/checksum.h:25,
                    from include/linux/skbuff.h:31,
                    from include/linux/if_ether.h:23,
                    from include/uapi/linux/ethtool.h:18,
                    from include/linux/ethtool.h:17,
                    from net/core/ethtool.c:18:
   net/core/ethtool.c: In function 'ethtool_get_regs':
>> arch/cris/include/asm/uaccess.h:380:10: warning: 'regbuf' may be used 
>> uninitialized in this function [-Wmaybe-uninitialized]
      return __copy_user(to, from, n);
             ^~~~~~~~~~~~~~~~~~~~~~~~
   net/core/ethtool.c:1395:8: note: 'regbuf' was declared here
     void *regbuf;
           ^~~~~~

vim +/regbuf +380 arch/cris/include/asm/uaccess.h

eb47e0293 arch/cris/include/asm/uaccess.h Al Viro        2016-08-18  364        
        memset(to, 0, n);
eb47e0293 arch/cris/include/asm/uaccess.h Al Viro        2016-08-18  365        
        return n;
eb47e0293 arch/cris/include/asm/uaccess.h Al Viro        2016-08-18  366        
}
eb47e0293 arch/cris/include/asm/uaccess.h Al Viro        2016-08-18  367        
if (__builtin_constant_p(n))
eb47e0293 arch/cris/include/asm/uaccess.h Al Viro        2016-08-18  368        
        return __constant_copy_from_user(to, from, n);
eb47e0293 arch/cris/include/asm/uaccess.h Al Viro        2016-08-18  369        
else
eb47e0293 arch/cris/include/asm/uaccess.h Al Viro        2016-08-18  370        
        return __copy_user_zeroing(to, from, n);
eb47e0293 arch/cris/include/asm/uaccess.h Al Viro        2016-08-18  371  }
^1da177e4 include/asm-cris/uaccess.h      Linus Torvalds 2005-04-16  372  
eb47e0293 arch/cris/include/asm/uaccess.h Al Viro        2016-08-18  373  
static inline size_t copy_to_user(void __user *to, const void *from, size_t n)
eb47e0293 arch/cris/include/asm/uaccess.h Al Viro        2016-08-18  374  {
eb47e0293 arch/cris/include/asm/uaccess.h Al Viro        2016-08-18  375        
if (unlikely(!access_ok(VERIFY_WRITE, to, n)))
eb47e0293 arch/cris/include/asm/uaccess.h Al Viro        2016-08-18  376        
        return n;
eb47e0293 arch/cris/include/asm/uaccess.h Al Viro        2016-08-18  377        
if (__builtin_constant_p(n))
eb47e0293 arch/cris/include/asm/uaccess.h Al Viro        2016-08-18  378        
        return __constant_copy_to_user(to, from, n);
eb47e0293 arch/cris/include/asm/uaccess.h Al Viro        2016-08-18  379        
else
eb47e0293 arch/cris/include/asm/uaccess.h Al Viro        2016-08-18 @380        
        return __copy_user(to, from, n);
eb47e0293 arch/cris/include/asm/uaccess.h Al Viro        2016-08-18  381  }
^1da177e4 include/asm-cris/uaccess.h      Linus Torvalds 2005-04-16  382  
^1da177e4 include/asm-cris/uaccess.h      Linus Torvalds 2005-04-16  383  /* We 
let the __ versions of copy_from/to_user inline, because they're often
^1da177e4 include/asm-cris/uaccess.h      Linus Torvalds 2005-04-16  384   * 
used in fast paths and have only a small space overhead.
^1da177e4 include/asm-cris/uaccess.h      Linus Torvalds 2005-04-16  385   */
^1da177e4 include/asm-cris/uaccess.h      Linus Torvalds 2005-04-16  386  
d9b5444ee include/asm-cris/uaccess.h      Adrian Bunk    2005-11-07  387  
static inline unsigned long
07f2402b4 include/asm-cris/uaccess.h      Jesper Nilsson 2008-03-04  388  
__generic_copy_from_user_nocheck(void *to, const void __user *from,

:::::: The code at line 380 was first introduced by commit
:::::: eb47e0293baaa3044022059f1fa9ff474bfe35cb cris: buggered 
copy_from_user/copy_to_user/clear_user

:::::: TO: Al Viro <[email protected]>
:::::: CC: Al Viro <[email protected]>

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

Attachment: .config.gz
Description: application/gzip

Reply via email to