All of lore.kernel.org
 help / color / mirror / Atom feed
* [jarkko-tpmdd:tpm2key-v8 11/12] crypto/asymmetric_keys/tpm2_key_rsa.c:633:10: warning: variable 'ret' is uninitialized when used here
@ 2024-11-04  6:30 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2024-11-04  6:30 UTC (permalink / raw)
  To: Jarkko Sakkinen; +Cc: oe-kbuild-all

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

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

only message in thread, other threads:[~2024-11-04  6:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-04  6:30 [jarkko-tpmdd:tpm2key-v8 11/12] crypto/asymmetric_keys/tpm2_key_rsa.c:633:10: warning: variable 'ret' is uninitialized when used here 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.