[PATCH 15/19] ipmi: kcs_bmc: Add a "raw" character device interface

kernel test robot lkp at intel.com
Mon Feb 22 02:36:02 AEDT 2021


Hi Andrew,

I love your patch! Perhaps something to improve:

[auto build test WARNING on char-misc/char-misc-testing]
[also build test WARNING on robh/for-next v5.11]
[cannot apply to joel-aspeed/for-next next-20210219]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Andrew-Jeffery/ipmi-Allow-raw-access-to-KCS-devices/20210219-223144
base:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git d19db80a366576d3ffadf2508ed876b4c1faf959
config: riscv-randconfig-r036-20210221 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project c9439ca36342fb6013187d0a69aef92736951476)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install riscv cross compiling tool for clang build
        # apt-get install binutils-riscv64-linux-gnu
        # https://github.com/0day-ci/linux/commit/8af4fb76b1183097f52d3c67196ae4dbadf508b2
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Andrew-Jeffery/ipmi-Allow-raw-access-to-KCS-devices/20210219-223144
        git checkout 8af4fb76b1183097f52d3c67196ae4dbadf508b2
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=riscv 

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

All warnings (new ones prefixed by >>):

>> drivers/char/ipmi/kcs_bmc_cdev_raw.c:396:2: warning: variable 'priv' is used uninitialized whenever 'for' loop exits because its condition is false [-Wsometimes-uninitialized]
           list_for_each_entry(pos, &kcs_bmc_raw_instances, entry) {
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   include/linux/list.h:629:7: note: expanded from macro 'list_for_each_entry'
                !list_entry_is_head(pos, head, member);                    \
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/char/ipmi/kcs_bmc_cdev_raw.c:405:7: note: uninitialized use occurs here
           if (!priv)
                ^~~~
   drivers/char/ipmi/kcs_bmc_cdev_raw.c:396:2: note: remove the condition if it is always true
           list_for_each_entry(pos, &kcs_bmc_raw_instances, entry) {
           ^
   include/linux/list.h:629:7: note: expanded from macro 'list_for_each_entry'
                !list_entry_is_head(pos, head, member);                    \
                ^
   drivers/char/ipmi/kcs_bmc_cdev_raw.c:393:26: note: initialize the variable 'priv' to silence this warning
           struct kcs_bmc_raw *priv, *pos;
                                   ^
                                    = NULL
   1 warning generated.


vim +396 drivers/char/ipmi/kcs_bmc_cdev_raw.c

   390	
   391	static int kcs_bmc_raw_detach_cdev(struct kcs_bmc_device *kcs_bmc)
   392	{
   393		struct kcs_bmc_raw *priv, *pos;
   394	
   395		spin_lock_irq(&kcs_bmc_raw_instances_lock);
 > 396		list_for_each_entry(pos, &kcs_bmc_raw_instances, entry) {
   397			if (pos->client.dev == kcs_bmc) {
   398				priv = pos;
   399				list_del(&pos->entry);
   400				break;
   401			}
   402		}
   403		spin_unlock_irq(&kcs_bmc_raw_instances_lock);
   404	
   405		if (!priv)
   406			return 0;
   407	
   408		misc_deregister(&priv->miscdev);
   409		kcs_bmc_disable_device(kcs_bmc, &priv->client);
   410		devm_kfree(priv->client.dev->dev, priv);
   411	
   412		return 0;
   413	}
   414	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 38093 bytes
Desc: not available
URL: <http://lists.ozlabs.org/pipermail/openbmc/attachments/20210221/f9606cdf/attachment-0001.gz>


More information about the openbmc mailing list