Re: [PATCH 4/4] alpha: Move two assignments for the variable "res" in srm_env_proc_write()

From: kbuild test robot
Date: Wed Jan 18 2017 - 19:49:17 EST


Hi Markus,

[auto build test WARNING on linus/master]
[also build test WARNING on v4.10-rc4 next-20170118]
[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/SF-Markus-Elfring/alpha-Fine-tuning-for-five-function-implementations/20170119-075247
config: alpha-defconfig (attached as .config)
compiler: alpha-linux-gnu-gcc (Debian 6.1.1-9) 6.1.1 20160705
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=alpha

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/alpha/kernel/srm_env.c: In function 'srm_env_proc_write':
>> arch/alpha/kernel/srm_env.c:108:6: warning: 'res' may be used uninitialized in this function [-Wmaybe-uninitialized]
int res;
^~~

vim +/res +108 arch/alpha/kernel/srm_env.c

0ead0f84 Alexey Dobriyan 2009-12-14 92 seq_write(m, page, ret);
0ead0f84 Alexey Dobriyan 2009-12-14 93 ret = 0;
16b7f4dc Jan-Benedict Glaw 2006-11-07 94 } else
0ead0f84 Alexey Dobriyan 2009-12-14 95 ret = -EFAULT;
0ead0f84 Alexey Dobriyan 2009-12-14 96 free_page((unsigned long)page);
0ead0f84 Alexey Dobriyan 2009-12-14 97 return ret;
0ead0f84 Alexey Dobriyan 2009-12-14 98 }
^1da177e Linus Torvalds 2005-04-16 99
0ead0f84 Alexey Dobriyan 2009-12-14 100 static int srm_env_proc_open(struct inode *inode, struct file *file)
0ead0f84 Alexey Dobriyan 2009-12-14 101 {
d9dda78b Al Viro 2013-03-31 102 return single_open(file, srm_env_proc_show, PDE_DATA(inode));
^1da177e Linus Torvalds 2005-04-16 103 }
^1da177e Linus Torvalds 2005-04-16 104
0ead0f84 Alexey Dobriyan 2009-12-14 105 static ssize_t srm_env_proc_write(struct file *file, const char __user *buffer,
0ead0f84 Alexey Dobriyan 2009-12-14 106 size_t count, loff_t *pos)
^1da177e Linus Torvalds 2005-04-16 107 {
^1da177e Linus Torvalds 2005-04-16 @108 int res;
1c1ec6c6 Al Viro 2013-03-31 109 unsigned long id = (unsigned long)PDE_DATA(file_inode(file));
^1da177e Linus Torvalds 2005-04-16 110 char *buf = (char *) __get_free_page(GFP_USER);
^1da177e Linus Torvalds 2005-04-16 111 unsigned long ret1, ret2;
^1da177e Linus Torvalds 2005-04-16 112
^1da177e Linus Torvalds 2005-04-16 113 if (!buf)
^1da177e Linus Torvalds 2005-04-16 114 return -ENOMEM;
^1da177e Linus Torvalds 2005-04-16 115
cb234559 Markus Elfring 2017-01-18 116 if (count >= PAGE_SIZE) {

:::::: The code at line 108 was first introduced by commit
:::::: 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 Linux-2.6.12-rc2

:::::: TO: Linus Torvalds <torvalds@xxxxxxxxxxxxxxx>
:::::: CC: Linus Torvalds <torvalds@xxxxxxxxxxxxxxx>

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

Attachment: .config.gz
Description: application/gzip