llvm.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [ardb:acomp-zswap-cleanup 7/21] fs/ubifs/compress.c:216:8: warning: variable 'ret' is used uninitialized whenever 'if' condition is false
@ 2023-07-19 10:43 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2023-07-19 10:43 UTC (permalink / raw)
  To: Ard Biesheuvel; +Cc: llvm, oe-kbuild-all

tree:   git://git.kernel.org/pub/scm/linux/kernel/git/ardb/linux.git acomp-zswap-cleanup
head:   d0a9c8530b6b8659bc8b126638f5d2c907cfe5ee
commit: 9bb0bd982a78fa5d1dadadad46171275df3fae80 [7/21] ubifs: Migrate to acomp compression API
config: x86_64-randconfig-r014-20230718 (https://download.01.org/0day-ci/archive/20230719/202307191846.iCTVysLT-lkp@intel.com/config)
compiler: clang version 15.0.7 (https://github.com/llvm/llvm-project.git 8dfdcc7b7bf66834a761bd8de445840ef68e4d1a)
reproduce: (https://download.01.org/0day-ci/archive/20230719/202307191846.iCTVysLT-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202307191846.iCTVysLT-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> fs/ubifs/compress.c:216:8: warning: variable 'ret' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
                           if (!compr->req) {
                               ^~~~~~~~~~~
   fs/ubifs/compress.c:222:7: note: uninitialized use occurs here
                   if (ret) {
                       ^~~
   fs/ubifs/compress.c:216:4: note: remove the 'if' if its condition is always true
                           if (!compr->req) {
                           ^~~~~~~~~~~~~~~~~
   fs/ubifs/compress.c:208:11: note: initialize the variable 'ret' to silence this warning
                   long ret;
                           ^
                            = 0
   1 warning generated.


vim +216 fs/ubifs/compress.c

   197	
   198	/**
   199	 * compr_init - initialize a compressor.
   200	 * @compr: compressor description object
   201	 *
   202	 * This function initializes the requested compressor and returns zero in case
   203	 * of success or a negative error code in case of failure.
   204	 */
   205	static int __init compr_init(struct ubifs_compressor *compr)
   206	{
   207		if (compr->capi_name) {
   208			long ret;
   209	
   210			compr->cc = crypto_alloc_acomp(compr->capi_name, 0,
   211						       CRYPTO_ALG_ASYNC);
   212			if (IS_ERR(compr->cc)) {
   213				ret = PTR_ERR(compr->cc);
   214			} else {
   215				compr->req = acomp_request_alloc(compr->cc);
 > 216				if (!compr->req) {
   217					crypto_free_acomp(compr->cc);
   218					ret = -ENOMEM;
   219				}
   220			}
   221	
   222			if (ret) {
   223				pr_err("UBIFS error (pid %d): cannot initialize compressor %s, error %ld",
   224				       current->pid, compr->name, ret);
   225				return ret;
   226			}
   227		}
   228	
   229		ubifs_compressors[compr->compr_type] = compr;
   230		return 0;
   231	}
   232	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

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

only message in thread, other threads:[~2023-07-19 10:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-19 10:43 [ardb:acomp-zswap-cleanup 7/21] fs/ubifs/compress.c:216:8: warning: variable 'ret' is used uninitialized whenever 'if' condition is false kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).