Skip to contentSkip to conversation

asym_tpm: Fix tpm_flushspecific return value

PATCH New Denis Kenzior 1 participant 1 message Aug 20, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 asym_tpm: Fix tpm_flushspecific return value

The return value from tpm_flushspecific is uint32_t, but is used in later patches like an int. This was reported by smatch:

crypto/asymmetric_keys/asym_tpm.c:728 tpm_key_sign() warn:
unsigned 'tpm_flushspecific(tb, keyhandle)' is never less than zero.

Fixes 9312b38b585d KEYS: asym_tpm: Add loadkey2 and flushspecific
---
 crypto/asymmetric_keys/asym_tpm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
crypto/asymmetric_keys/asym_tpm.c +1 -1
index 3753c2f1c4e9..cb7e55b8859f 100644
@@ -99,7 +99,7 @@ static int tpm_loadkey2(struct tpm_buf *tb,
 /*
  * Execute the FlushSpecific TPM command
  */
-static uint32_t tpm_flushspecific(struct tpm_buf *tb, uint32_t handle)
+static int tpm_flushspecific(struct tpm_buf *tb, uint32_t handle)
 {
 	INIT_BUF(tb);
 	store16(tb, TPM_TAG_RQU_COMMAND);
Signature · 1 line
2.16.1