All of lore.kernel.org
 help / color / mirror / Atom feed
* [jens.wiklander:optee_ffa 3/5] drivers/tee/optee/call.c:196:6: warning: variable 'rc' is used uninitialized whenever 'if' condition is false
@ 2021-05-24 17:55 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-05-24 17:55 UTC (permalink / raw)
  To: kbuild-all

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

tree:   https://git.linaro.org/people/jens.wiklander/linux-tee.git optee_ffa
head:   636bcfec71bba4457710dc447883d013efca34cd
commit: 5eb0b29b029730e189f336063775a6d52feb6a5d [3/5] optee: refactor driver with internal callbacks
config: arm64-randconfig-r026-20210524 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 93d1e5822ed64abd777eb94ea9899e96c4c39fbe)
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 arm64 cross compiling tool for clang build
        # apt-get install binutils-aarch64-linux-gnu
        git remote add jens.wiklander https://git.linaro.org/people/jens.wiklander/linux-tee.git
        git fetch --no-tags jens.wiklander optee_ffa
        git checkout 5eb0b29b029730e189f336063775a6d52feb6a5d
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm64 

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

All warnings (new ones prefixed by >>):

>> drivers/tee/optee/call.c:196:6: warning: variable 'rc' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
           if (IS_ERR(ma)) {
               ^~~~~~~~~~
   drivers/tee/optee/call.c:205:6: note: uninitialized use occurs here
           if (rc) {
               ^~
   drivers/tee/optee/call.c:196:2: note: remove the 'if' if its condition is always true
           if (IS_ERR(ma)) {
           ^~~~~~~~~~~~~~~~
   drivers/tee/optee/call.c:186:8: note: initialize the variable 'rc' to silence this warning
           int rc;
                 ^
                  = 0
   drivers/tee/optee/call.c:661:6: warning: variable 'rc' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
           if (optee->ops->do_call_with_arg(ctx, shm) ||
               ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/tee/optee/call.c:665:9: note: uninitialized use occurs here
           return rc;
                  ^~
   drivers/tee/optee/call.c:661:2: note: remove the 'if' if its condition is always true
           if (optee->ops->do_call_with_arg(ctx, shm) ||
           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   drivers/tee/optee/call.c:650:8: note: initialize the variable 'rc' to silence this warning
           int rc;
                 ^
                  = 0
   2 warnings generated.


vim +196 drivers/tee/optee/call.c

4fb0a5eb364d23 Jens Wiklander 2015-04-14  182  
4fb0a5eb364d23 Jens Wiklander 2015-04-14  183  static struct tee_shm *get_msg_arg(struct tee_context *ctx, size_t num_params,
5eb0b29b029730 Jens Wiklander 2021-03-25  184  				   struct optee_msg_arg **msg_arg)
4fb0a5eb364d23 Jens Wiklander 2015-04-14  185  {
4fb0a5eb364d23 Jens Wiklander 2015-04-14  186  	int rc;
4fb0a5eb364d23 Jens Wiklander 2015-04-14  187  	struct tee_shm *shm;
4fb0a5eb364d23 Jens Wiklander 2015-04-14  188  	struct optee_msg_arg *ma;
4fb0a5eb364d23 Jens Wiklander 2015-04-14  189  
4fb0a5eb364d23 Jens Wiklander 2015-04-14  190  	shm = tee_shm_alloc(ctx, OPTEE_MSG_GET_ARG_SIZE(num_params),
4fb0a5eb364d23 Jens Wiklander 2015-04-14  191  			    TEE_SHM_MAPPED);
4fb0a5eb364d23 Jens Wiklander 2015-04-14  192  	if (IS_ERR(shm))
4fb0a5eb364d23 Jens Wiklander 2015-04-14  193  		return shm;
4fb0a5eb364d23 Jens Wiklander 2015-04-14  194  
4fb0a5eb364d23 Jens Wiklander 2015-04-14  195  	ma = tee_shm_get_va(shm, 0);
4fb0a5eb364d23 Jens Wiklander 2015-04-14 @196  	if (IS_ERR(ma)) {
4fb0a5eb364d23 Jens Wiklander 2015-04-14  197  		rc = PTR_ERR(ma);
4fb0a5eb364d23 Jens Wiklander 2015-04-14  198  		goto out;
4fb0a5eb364d23 Jens Wiklander 2015-04-14  199  	}
4fb0a5eb364d23 Jens Wiklander 2015-04-14  200  
4fb0a5eb364d23 Jens Wiklander 2015-04-14  201  	memset(ma, 0, OPTEE_MSG_GET_ARG_SIZE(num_params));
4fb0a5eb364d23 Jens Wiklander 2015-04-14  202  	ma->num_params = num_params;
4fb0a5eb364d23 Jens Wiklander 2015-04-14  203  	*msg_arg = ma;
4fb0a5eb364d23 Jens Wiklander 2015-04-14  204  out:
4fb0a5eb364d23 Jens Wiklander 2015-04-14  205  	if (rc) {
4fb0a5eb364d23 Jens Wiklander 2015-04-14  206  		tee_shm_free(shm);
4fb0a5eb364d23 Jens Wiklander 2015-04-14  207  		return ERR_PTR(rc);
4fb0a5eb364d23 Jens Wiklander 2015-04-14  208  	}
4fb0a5eb364d23 Jens Wiklander 2015-04-14  209  
4fb0a5eb364d23 Jens Wiklander 2015-04-14  210  	return shm;
4fb0a5eb364d23 Jens Wiklander 2015-04-14  211  }
4fb0a5eb364d23 Jens Wiklander 2015-04-14  212  

:::::: The code at line 196 was first introduced by commit
:::::: 4fb0a5eb364d239722e745c02aef0dbd4e0f1ad2 tee: add OP-TEE driver

:::::: TO: Jens Wiklander <jens.wiklander@linaro.org>
:::::: CC: Jens Wiklander <jens.wiklander@linaro.org>

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

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

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

only message in thread, other threads:[~2021-05-24 17:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-24 17:55 [jens.wiklander:optee_ffa 3/5] drivers/tee/optee/call.c:196:6: warning: variable 'rc' is used uninitialized whenever 'if' condition is false kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.