asym_tpm: Fix tpm_flushspecific return value
Subsystems (3)
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
Signed-off-by Denis Kenzior <[email protected]>
--- crypto/asymmetric_keys/asym_tpm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
crypto/asymmetric_keys/asym_tpm.c +1 -1
@@ -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