All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Jarkko Sakkinen <jarkko@kernel.org>
Cc: oe-kbuild-all@lists.linux.dev
Subject: [jarkko-tpmdd:tpm2key-v8 11/12] crypto/asymmetric_keys/tpm2_key_rsa.c:633:10: warning: variable 'ret' is uninitialized when used here
Date: Mon, 4 Nov 2024 14:30:34 +0800	[thread overview]
Message-ID: <202411041402.87goDFKV-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd.git tpm2key-v8
head:   676e39dca229e7ee2b1d90a1e8accda6fdede98f
commit: 70ff943241a1202554120aa67fdb4708c684fed4 [11/12] KEYS: asymmetric: Add tpm2_key_rsa signer
config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20241104/202411041402.87goDFKV-lkp@intel.com/config)
compiler: clang version 19.1.3 (https://github.com/llvm/llvm-project ab51eccf88f5321e7c60591c5546b254b6afab99)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20241104/202411041402.87goDFKV-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/202411041402.87goDFKV-lkp@intel.com/

All warnings (new ones prefixed by >>):

   In file included from crypto/asymmetric_keys/tpm2_key_rsa.c:21:
   In file included from include/keys/trusted-type.h:12:
   In file included from include/linux/tpm.h:24:
   In file included from include/linux/highmem.h:8:
   In file included from include/linux/cacheflush.h:5:
   In file included from arch/x86/include/asm/cacheflush.h:5:
   In file included from include/linux/mm.h:2213:
   include/linux/vmstat.h:504:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     504 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     505 |                            item];
         |                            ~~~~
   include/linux/vmstat.h:511:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     511 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     512 |                            NR_VM_NUMA_EVENT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~~
   include/linux/vmstat.h:518:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
     518 |         return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
         |                               ~~~~~~~~~~~ ^ ~~~
   include/linux/vmstat.h:524:43: warning: arithmetic between different enumeration types ('enum zone_stat_item' and 'enum numa_stat_item') [-Wenum-enum-conversion]
     524 |         return vmstat_text[NR_VM_ZONE_STAT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~ ^
     525 |                            NR_VM_NUMA_EVENT_ITEMS +
         |                            ~~~~~~~~~~~~~~~~~~~~~~
>> crypto/asymmetric_keys/tpm2_key_rsa.c:633:10: warning: variable 'ret' is uninitialized when used here [-Wuninitialized]
     633 |                 return ret;
         |                        ^~~
   crypto/asymmetric_keys/tpm2_key_rsa.c:629:9: note: initialize the variable 'ret' to silence this warning
     629 |         int ret;
         |                ^
         |                 = 0
   5 warnings generated.


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

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

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

                 reply	other threads:[~2024-11-04  6:30 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=202411041402.87goDFKV-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=jarkko@kernel.org \
    --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.