Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Jarkko Sakkinen <jarkko@kernel.org>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
	James Prestwood <prestwoj@gmail.com>
Subject: [jarkko-tpmdd:tpm2key-v8 10/11] crypto/asymmetric_keys/tpm2_key_rsa.c:636:10: warning: variable 'ret' is uninitialized when used here
Date: Wed, 11 Sep 2024 15:55:56 +0800	[thread overview]
Message-ID: <202409111527.uF380T7Y-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd.git tpm2key-v8
head:   79e909153c0a5ac21c2c5c0d4eac9229b3408178
commit: 7d90c72ea84705971e66e2023d388c2d9958220d [10/11] keys: asymmetric: Add tpm2_key_rsa
config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20240911/202409111527.uF380T7Y-lkp@intel.com/config)
compiler: clang version 18.1.8 (https://github.com/llvm/llvm-project 3b5b5c1ec4a3095ab096dd780e84d7ab81f3d7ff)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240911/202409111527.uF380T7Y-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/202409111527.uF380T7Y-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> crypto/asymmetric_keys/tpm2_key_rsa.c:636:10: warning: variable 'ret' is uninitialized when used here [-Wuninitialized]
     636 |                 return ret;
         |                        ^~~
   crypto/asymmetric_keys/tpm2_key_rsa.c:632:9: note: initialize the variable 'ret' to silence this warning
     632 |         int ret;
         |                ^
         |                 = 0
   1 warning generated.


vim +/ret +636 crypto/asymmetric_keys/tpm2_key_rsa.c

   625	
   626	/*
   627	 * Attempt to parse a data blob for a key as a TPM private key blob.
   628	 */
   629	static int tpm2_key_rsa_preparse(struct key_preparsed_payload *prep)
   630	{
   631		struct tpm2_key *key;
   632		int ret;
   633	
   634		key = tpm2_key_decode(prep->data, prep->datalen);
   635		if (IS_ERR(key))
 > 636			return ret;
   637	
   638		if (key->oid != OID_TPMLoadableKey) {
   639			kfree(key);
   640			return -EBADMSG;
   641		}
   642	
   643		ret = __tpm2_key_rsa_preparse(key);
   644		if (ret < 0) {
   645			kfree(key);
   646			return ret;
   647		}
   648	
   649		prep->payload.data[asym_subtype] = &tpm2_key_rsa_subtype;
   650		prep->payload.data[asym_key_ids] = NULL;
   651		prep->payload.data[asym_crypto] = key;
   652		prep->payload.data[asym_auth] = NULL;
   653		prep->quotalen = 100;
   654	
   655		return 0;
   656	}
   657	

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

                 reply	other threads:[~2024-09-11  7:56 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=202409111527.uF380T7Y-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=jarkko@kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=prestwoj@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox