All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Ard Biesheuvel <ardb@kernel.org>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev
Subject: [ardb:acomp-zswap-cleanup 7/21] fs/ubifs/compress.c:216:8: warning: variable 'ret' is used uninitialized whenever 'if' condition is false
Date: Wed, 19 Jul 2023 18:43:21 +0800	[thread overview]
Message-ID: <202307191846.iCTVysLT-lkp@intel.com> (raw)

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

                 reply	other threads:[~2023-07-19 10:43 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202307191846.iCTVysLT-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=ardb@kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=oe-kbuild-all@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.